Added a check when the "Origin" header is undefined.

Also, took out a check that was no longer needed. Line 51 catches if origin *is* false, no need to check it isn't on line 78.