mirror of
https://github.com/diced/zipline.git
synced 2026-01-26 11:14:54 -08:00
fix: OPTIONS being blocked
This commit is contained in:
@@ -59,9 +59,11 @@ export const withZipline =
|
||||
api_config: ZiplineApiConfig = { methods: ['GET'] }
|
||||
) =>
|
||||
(req: NextApiReq, res: NextApiRes) => {
|
||||
api_config.methods.push('OPTIONS');
|
||||
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
res.setHeader('Access-Content-Allow-Methods', 'GET,HEAD,POST,OPTIONS');
|
||||
res.setHeader('Access-Content-Allow-Methods', api_config.methods.join(','));
|
||||
res.setHeader('Access-Control-Max-Age', '86400');
|
||||
|
||||
// Used when the client sends wrong information, etc.
|
||||
|
||||
Reference in New Issue
Block a user