Fix condition on optional Referer header

Fixes access to assets. The Referer header is optional; assets serving will fail if user agent doesn't provide it.