mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
set headers on options
This commit is contained in:
parent
c046166834
commit
0ee4b4ff4b
@ -27,9 +27,10 @@ export default class Engine {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await this.app.use(async (req, res, next) => {
|
await this.app.use(async (req, res, next) => {
|
||||||
|
if (req.method === "OPTIONS") {
|
||||||
|
res.setHeader("Access-Control-Allow-Origin", "*")
|
||||||
res.setHeader("Access-Control-Allow-Headers", "Origin, Content-Type, Authorization")
|
res.setHeader("Access-Control-Allow-Headers", "Origin, Content-Type, Authorization")
|
||||||
|
|
||||||
if (req.method === "OPTIONS") {
|
|
||||||
return res.status(204).end()
|
return res.status(204).end()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user