Instead of switch use if

Instead of switch use if in req.header function because its 3 times faster in case of referer or referrer