Header checks after error checks

With this commit, you will see the following messages instead of
"Missing required request header ...":

 /iscorsneeded = no with direct browsing
 /favicon.ico = 404 not found