mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 02:24: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) => {
|
||||
res.setHeader("Access-Control-Allow-Headers", "Origin, Content-Type, Authorization")
|
||||
|
||||
if (req.method === "OPTIONS") {
|
||||
res.setHeader("Access-Control-Allow-Origin", "*")
|
||||
res.setHeader("Access-Control-Allow-Headers", "Origin, Content-Type, Authorization")
|
||||
|
||||
return res.status(204).end()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user