mirror of https://github.com/calzoneman/sync.git
Fix getSafeReferrer when referrer is null
This commit is contained in:
parent
cc69b3c225
commit
3d50b8f52e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue