We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fa5a06 commit 4527bf0Copy full SHA for 4527bf0
src/addCORSHeaders.ts
@@ -6,6 +6,11 @@ import type {
6
7
export const addCORSHeaders = (
8
AccessControlAllowOrigin: string = '*',
9
+ AccessControlExposeHeaders: Array<string> = [
10
+ 'x-amzn-requestid',
11
+ 'etag',
12
+ 'apigw-requestid',
13
+ ],
14
): MiddlewareObj<APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2> => {
15
const setCORSHeaders = async (req: Request) => {
16
if (req.response === null) return
@@ -14,6 +19,7 @@ export const addCORSHeaders = (
19
headers: {
20
...(req.response.headers ?? {}),
21
'Access-Control-Allow-Origin': AccessControlAllowOrigin,
22
+ 'Access-Control-Expose-Headers': AccessControlExposeHeaders.join(', '),
17
23
},
18
24
}
25
0 commit comments