aboutsummaryrefslogtreecommitdiff
path: root/src/api/structures/Server.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2018-09-18 03:34:00 -0300
committerPitu <[email protected]>2018-09-18 03:34:00 -0300
commit4b2b02110b457d8ebeee78e1bdf99eb0660d0626 (patch)
treea6e30208b61e3927c1681c7006241cd0d837de89 /src/api/structures/Server.js
parentStupid hash was working, the size changes for some reason when uploading (diff)
downloadhost.fuwn.me-4b2b02110b457d8ebeee78e1bdf99eb0660d0626.tar.xz
host.fuwn.me-4b2b02110b457d8ebeee78e1bdf99eb0660d0626.zip
We can now download albums yayyyy
Diffstat (limited to 'src/api/structures/Server.js')
-rw-r--r--src/api/structures/Server.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api/structures/Server.js b/src/api/structures/Server.js
index ae4b678..0b05570 100644
--- a/src/api/structures/Server.js
+++ b/src/api/structures/Server.js
@@ -24,6 +24,10 @@ class Server {
this.server.use(helmet());
this.server.use(cors({ allowedHeaders: ['Accept', 'Authorization', 'Cache-Control', 'X-Requested-With', 'Content-Type', 'albumId'] }));
this.server.use((req, res, next) => {
+ /*
+ 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 === 'application/vnd.lolisafe.json') return next();
return res.status(405).json({ message: 'Incorrect `Accept` header provided' });
});