From 72d6d6a8ac6c6226fe91e3289f88f7d11c51fff2 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 19 Oct 2024 09:54:12 -0700 Subject: [PATCH] chore: explicit searches --- server.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server.js b/server.js index ba675779..1ca4c0a2 100644 --- a/server.js +++ b/server.js @@ -44,6 +44,13 @@ app.use((req, res, next) => { if (req.path.endsWith('.css')) res.setHeader('Content-Type', 'text/css') else if (req.path.endsWith('.js')) res.setHeader('Content-Type', 'application/javascript') else if (req.path.endsWith('.json')) res.setHeader('Content-Type', 'application/json') + else if (req.path.startsWith('/api/')) res.setHeader('Content-Type', 'application/json') + else if (req.path.startsWith('/feeds/all')) res.setHeader('Content-Type', 'application/xml') + else if (req.path.startsWith('/feeds/books')) res.setHeader('Content-Type', 'application/xml') + else if (req.path.startsWith('/feeds/links')) res.setHeader('Content-Type', 'application/xml') + else if (req.path.startsWith('/feeds/movies')) res.setHeader('Content-Type', 'application/xml') + else if (req.path.startsWith('/feeds/posts')) res.setHeader('Content-Type', 'application/xml') + else if (req.path.startsWith('/feeds/syndication')) res.setHeader('Content-Type', 'application/xml') next() })