|
@@ -16,6 +16,7 @@ type DataType = {
|
|
origins?: string[]
|
|
origins?: string[]
|
|
methods?: string[]
|
|
methods?: string[]
|
|
headers?: string[]
|
|
headers?: string[]
|
|
|
|
+ expose?: string[]
|
|
preflight?: boolean
|
|
preflight?: boolean
|
|
credentials?: boolean
|
|
credentials?: boolean
|
|
maxAge?: number
|
|
maxAge?: number
|
|
@@ -87,6 +88,9 @@ export const CorsInput = ({...props}: AutoTypeInputProps)=>{
|
|
if (!isNull(values.credentials)){
|
|
if (!isNull(values.credentials)){
|
|
lines.push(`add_header Access-Control-Allow-Credentials '${values.credentials ? 'true': 'false'}';`)
|
|
lines.push(`add_header Access-Control-Allow-Credentials '${values.credentials ? 'true': 'false'}';`)
|
|
}
|
|
}
|
|
|
|
+ if (values.expose?.length){
|
|
|
|
+ lines.push(`add_header 'Access-Control-Expose-Headers' '${values.expose.join(',')}';`)
|
|
|
|
+ }
|
|
if (!isNull(values.preflight)){
|
|
if (!isNull(values.preflight)){
|
|
lines.push(`if ($request_method = 'OPTIONS') {
|
|
lines.push(`if ($request_method = 'OPTIONS') {
|
|
return 204;
|
|
return 204;
|