Discard invalid Referer header

If an invalid Referer header such as "http://example.com/bad|uri" is
provided, ignore the value of it and skip using the Host header fallback.
refactor instantiation
fix typoed header name
Merge pull request #74 from statianzo/invalid-referer

Discard invalid Referer header