Fix checking length of endefined
This commit is contained in:
parent
af8e7e7044
commit
a8633e34b2
1 changed files with 1 additions and 1 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue