mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-31 23:20:05 +02:00
Remove global CORS for api endpoints and setup temp CORS check for ebook endpoint
This commit is contained in:
parent
56c574c928
commit
4c2c320b9d
2 changed files with 27 additions and 15 deletions
|
@ -17,18 +17,6 @@ class Auth {
|
|||
constructor() {
|
||||
}
|
||||
|
||||
static cors(req, res, next) {
|
||||
res.header('Access-Control-Allow-Origin', '*')
|
||||
res.header("Access-Control-Allow-Methods", 'GET, POST, PATCH, PUT, DELETE, OPTIONS')
|
||||
res.header('Access-Control-Allow-Headers', '*')
|
||||
res.header('Access-Control-Allow-Credentials', true)
|
||||
if (req.method === 'OPTIONS') {
|
||||
res.sendStatus(200)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inializes all passportjs strategies and other passportjs ralated initialization.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue