Added checks for http headers and content