Allow for a referrer to be specified
The logic is not quite right; it can be HTTP codes too
Fix the HTTP-error code case