Skip to content

Commit 3053ef3

Browse files
committed
Expose X-Request-Id header in response
1 parent 94e7922 commit 3053ef3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "labelzoom-cf-api-proxy",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"private": true,
55
"scripts": {
66
"deploy": "wrangler deploy",

src/cors.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const corsHeaders = {
33
"Access-Control-Allow-Methods": "GET,HEAD,POST,PUT,DELETE,OPTIONS",
44
"Access-Control-Max-Age": "86400",
55
"Access-Control-Allow-Credentials": "true",
6+
"Access-Control-Expose-Headers": "X-Request-Id",
67
};
78

89
/**
@@ -53,6 +54,7 @@ export function responseWithAllowOrigin(response: Response, origin = '*'): Respo
5354
// Add cache control headers
5455
newResponse.headers.set('Access-Control-Allow-Origin', origin);
5556
newResponse.headers.set('Access-Control-Allow-Credentials', 'true');
57+
newResponse.headers.set('Access-Control-Expose-Headers', 'X-Request-Id');
5658

5759
return newResponse;
5860
}

0 commit comments

Comments
 (0)