improved HTTP server handling of errors while reading header