I have a HTTP request which is failing with 400 error. I did packet capture and found that in the request headers there is header like below: X-Policy: NX\000\r\n
So it looks like NULL character and then CRLF what most likely mean end of message headers and start of message body. Since this is not the last header I'm getting 400.
Question 1: Is my guess correct about cause of 400 error? Question 2: is this behavior is per a RFC? If so can you please give the RFC number.
Thanks.
You can't have a NUL character in a header field; see http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p1-messaging-25.html#header.fields and http://greenbytes.de/tech/webdav/rfc2616.html#message.headers.