CRLF In HTTP Response Headers

A quick note: App Engine will convert CRLF characters in headers (new line characters, such as /r and /n) into underscore characters.

For example, setting the following header should cause Line One and Line Two to appear on two different lines:

resp.setHeader("Example-Header-Name", "Line One \r\n Line Two");

App Engine will run this code, but it will convert the newline characters into two underscore characters before sending the header to the client browser.

While the HTTP 1.1 specification allows header fields to be split across multiple lines (RFC 2616 Section 4.2), App Engine apparently doesn’t allow this. It isn’t too much of an inconvenience, since response headers can be grouped up into one line, but it’s a good idea to keep this limitation in mind especially when communicating with APIs.