Fix checking length of endefined

This commit is contained in:
Shawn 2018-10-25 14:07:11 -05:00
parent af8e7e7044
commit a8633e34b2

View file

@ -9,7 +9,7 @@ function logMetricsMiddleware(req, res, next) {
let referrer = req.get('referrer');
if(referrer.length > 255) {
if(referrer && referrer.length > 255) {
// Attempt to "safely" clamp long URLs
referrer = /(.*?)#.*/.exec(referrer)[1];