aboutsummaryrefslogtreecommitdiff
path: root/src/api/structures/Server.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-04-16 02:56:49 +0000
committerPitu <[email protected]>2019-04-16 02:56:49 +0000
commit5dc7eda038d673767fbb0f872632695b42a21304 (patch)
tree0e260c7ab49acfed08110ded9605edd0c36058bc /src/api/structures/Server.js
parentDitched sqlite. Use postgres or mysql/mariadb (diff)
downloadhost.fuwn.me-5dc7eda038d673767fbb0f872632695b42a21304.tar.xz
host.fuwn.me-5dc7eda038d673767fbb0f872632695b42a21304.zip
Check if accept header is passed
Diffstat (limited to 'src/api/structures/Server.js')
-rw-r--r--src/api/structures/Server.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/structures/Server.js b/src/api/structures/Server.js
index d10abc9..f8c6ad1 100644
--- a/src/api/structures/Server.js
+++ b/src/api/structures/Server.js
@@ -27,7 +27,7 @@ class Server {
This bypasses the headers.accept for album download, since it's accesed directly through the browser.
*/
if (req.url.includes('/api/album/') && req.url.includes('/zip') && req.method === 'GET') return next();
- if (req.headers.accept.includes('application/vnd.lolisafe.json')) return next();
+ if (req.headers.accept && req.headers.accept.includes('application/vnd.lolisafe.json')) return next();
return res.status(405).json({ message: 'Incorrect `Accept` header provided' });
});
this.server.use(bodyParser.urlencoded({ extended: true }));