mirror of
https://github.com/bewcloud/bewcloud.git
synced 2026-03-11 08:54:49 +00:00
Better CORS response
This commit is contained in:
parent
265c52a7e5
commit
c1443191ce
1 changed files with 6 additions and 1 deletions
|
|
@ -12,7 +12,12 @@ export const handler = [
|
|||
const origin = request.headers.get('Origin') || '*';
|
||||
const headers = response.headers;
|
||||
headers.set('Access-Control-Allow-Origin', origin);
|
||||
headers.set('Access-Control-Allow-Methods', 'DELETE');
|
||||
headers.set('Access-Control-Allow-Credentials', 'true');
|
||||
headers.set('Access-Control-Allow-Methods', 'POST, OPTIONS, GET, PUT, DELETE');
|
||||
headers.set(
|
||||
'Access-Control-Allow-Headers',
|
||||
'Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With',
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue