Fix getSafeReferrer when referrer is null

This commit is contained in:
Calvin Montgomery 2017-08-24 20:55:18 -07:00
parent cc69b3c225
commit 3d50b8f52e

View file

@ -20,6 +20,11 @@ const LOGGER = require('@calzoneman/jsli')('web/auth');
function getSafeReferrer(req) {
const referrer = req.header('referer');
if (!referrer) {
return null;
}
const { hostname } = url.parse(referrer);
// TODO: come back to this when refactoring http alt domains