@based/server
Advanced tools
Comparing version 6.7.0 to 6.7.1
@@ -108,5 +108,3 @@ "use strict"; | ||
}; | ||
if (!((method === 'post' && route.type === 'stream') | ||
// ctx.session.headers['content-type'].includes('multipart/form-data') | ||
)) { | ||
if (method === 'options') { | ||
const defHeaders = 'Authorization,Content-Type'; | ||
@@ -131,2 +129,7 @@ if (route.headers) { | ||
} | ||
else if (route.headers) { | ||
for (const header of route.headers) { | ||
ctx.session.headers[header] = req.getHeader(header); | ||
} | ||
} | ||
if ((0, security_1.rateLimitRequest)(server, ctx, route.rateLimitTokens, server.rateLimit.http)) { | ||
@@ -133,0 +136,0 @@ (0, security_1.endRateLimitHttp)(res); |
@@ -10,2 +10,7 @@ "use strict"; | ||
} | ||
if (ctx.session.method !== 'options') { | ||
ctx.session.res.writeHeader('Access-Control-Allow-Headers', '*'); | ||
ctx.session.res.writeHeader('Access-Control-Expose-Headers', '*'); | ||
ctx.session.res.writeHeader('Access-Control-Allow-Origin', '*'); | ||
} | ||
if (payload === undefined || ctx.session.method === 'options') { | ||
@@ -91,3 +96,2 @@ ctx.session.res.end(); | ||
ctx.session.res.writeHeader('Cache-Control', 'max-age=0, must-revalidate'); | ||
ctx.session.res.writeHeader('Access-Control-Allow-Headers', 'Authorization'); | ||
} | ||
@@ -94,0 +98,0 @@ if (encoding) { |
{ | ||
"name": "@based/server", | ||
"version": "6.7.0", | ||
"version": "6.7.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
395657
5975