question

TimothyAitchison-9035 avatar image
0 Votes"
TimothyAitchison-9035 asked lextm edited

IIS Server Variable ALL_HTTP converts CrLf to Lf

When using the IIS Server Variable ALL_HTTP, each header has a line ending of Lf (Linux-style) rather than the Windows standards CrLf.
This occurs even when the HTTP header of the incoming request has the headers delimited by CrLf, that is, the ALL_RAW server variable is delimited by CrLf.

It looks like the line endings are getting converted somewhere.

What should the line endings be for ALL_HTTP?

windows-server-iis
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@TimothyAitchison-9035 I don't think it is IIS Server Variable ALL_HTTP that converts CrLf to Lf, have you tested other IIS Server Variables? file transfer clients and servers support a text/ASCII transfer mode. When transferring a file in this mode, the file gets converted from a format native to a source system, to a format native to a target system. For example, when uploading a text file using text mode from Windows to Unix system, the file line endings get converted from CR+LF to LF. Opposite to the text/ASCII transfer mode is a binary transfer mode that transfer the file as is.

0 Votes 0 ·

The HTTP protocol itself only determines what line ending to use when sending data over the wire (within HTTP packets), so you can see from RFC2616 (and others) that CRLF is needed, https://tools.ietf.org/html/rfc2616#page-31 But ALL_HTTP and ALL_RAW are server variables maintained and defined by IIS (not available in other web servers like Apache), so it is decided by Microsoft engineers which line ending to use. What you see is what you get.

0 Votes 0 ·

0 Answers