Merge pull request #661 from lbryio/trending-metrics

Fix checking length of endefined
This commit is contained in:
Shawn K 2018-10-25 14:07:41 -05:00 committed by GitHub
commit 51dd0c637f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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