Fix handling of http content and headers