fixes bug where route referer was not being interpreted

Fixes an issue where `route.referer` was not being recognized correctly on test or when an app hijacked the request referer. Squash bug 28