mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:47:07 +00:00
Accept mime query parameter
This commit is contained in:
@@ -9,9 +9,9 @@ module.exports = async function (req, res, next) {
|
|||||||
"application/geo+json": geojson,
|
"application/geo+json": geojson,
|
||||||
"application/vnd.seis+json": seis
|
"application/vnd.seis+json": seis
|
||||||
};
|
};
|
||||||
|
|
||||||
const mimetype = req.accepts(Object.keys(handlers));
|
const mimetype = (handlers[req.query.mime] && req.query.mime) || req.accepts(Object.keys(handlers));
|
||||||
|
|
||||||
if (mimetype) {
|
if (mimetype) {
|
||||||
res.set("Content-Type", mimetype);
|
res.set("Content-Type", mimetype);
|
||||||
await handlers[mimetype](req, res, next);
|
await handlers[mimetype](req, res, next);
|
||||||
|
|||||||
Reference in New Issue
Block a user