Skip to content

Commit e830061

Browse files
authored
Merge pull request #379 from the-hideout/options-max-age
Set max age on options request
2 parents 574bd10 + f9cc5e2 commit e830061

File tree

4 files changed

+61
-68
lines changed

4 files changed

+61
-68
lines changed

http/package-lock.json

Lines changed: 50 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

http/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"nodemon": "^3.1.3"
1818
},
1919
"dependencies": {
20-
"@graphql-tools/merge": "9.0.21",
21-
"@graphql-tools/schema": "10.0.20",
22-
"graphql-yoga": "^5.12.1",
20+
"@graphql-tools/merge": "9.0.24",
21+
"@graphql-tools/schema": "10.0.23",
22+
"graphql-yoga": "^5.13.4",
2323
"dotenv": "^16.4.5",
2424
"uuid": "^11.1.0"
2525
},

index.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ export default {
202202
}
203203
if (request.method.toUpperCase() === 'OPTIONS') {
204204
const optionsResponse = new Response(null, {
205-
headers: { 'cache-control': 'public, max-age=2592000' },
205+
headers: {
206+
'cache-control': 'public, max-age=2592000',
207+
'Access-Control-Max-Age': '600',
208+
},
206209
});
207210
setCors(optionsResponse, graphQLOptions.cors);
208211
return optionsResponse;

plugins/plugin-option-method.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ export default function useOptionMethod() {
55
return;
66
}
77
const optionsResponse = new Response(null, {
8-
headers: { 'cache-control': 'public, max-age=2592000' },
8+
headers: {
9+
'cache-control': 'public, max-age=2592000',
10+
'Access-Control-Max-Age': '600',
11+
},
912
});
1013
//setCors(optionsResponse, graphQLOptions.cors);
1114
endResponse(optionsResponse);

0 commit comments

Comments
 (0)