From 270391a6e86e76e7cf44150fc0510aa74f2bd54e Mon Sep 17 00:00:00 2001 From: fenwick67 Date: Mon, 5 Aug 2019 16:19:27 -0400 Subject: [PATCH] log referer and URI encode redirects --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 290513c..74216d1 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ var morgan = require('morgan'); var app = Express(); -var logger = morgan('tiny') +var logger = morgan(':method :url :status via :referrer - :response-time ms') app.use( serveStatic('static',{ @@ -41,7 +41,7 @@ app.get('/api/feed',cors(),function(req,res){ var userUrl = feedUrl.replace(/\.atom$/i,''); var redirectUrl = '/apiv2/feed?'; - var qs = ['userurl='+userUrl]; + var qs = ['userurl='+encodeURIComponent(userUrl),"api=v1"]; (['size','theme','boosts','replies']).forEach(key=>{ if (typeof req.query[key] != 'undefined'){