Handle Referer not having a trailing slash

Fixes #415.

Created by  Eelco Dolstra  on November 1, 2016
E6S4CVUTZCLSJVH2HGYF5DUJP4VBS6WDDM5EI27XM6M6XB4S6QFQC
Change contents