IIS7 - Specifying content-length header in ASP causes “connection reset” error

前端 未结 3 700
庸人自扰
庸人自扰 2021-01-12 04:43

I\'m migrating a series of websites from an existing IIS5 server to a brand new IIS7 web server. One of the pages pulls a data file from a blob in the database and serves i

3条回答
  •  情深已故
    2021-01-12 05:43

    As already mentioned somewhere else: http://en.wikipedia.org/wiki/Chunked_transfer_encoding

    It uses the Transfer-Encoding HTTP response header in place of the Content-Length header, which the protocol would otherwise require. Because the Content-Length header is not used, the server does not need to know the length of the content before it starts transmitting a response to the client (usually a web browser). Web servers can begin transmitting responses with dynamically-generated content before knowing the total size of that content.

    In IIS7 this is enabled by default: http://technet.microsoft.com/en-us/library/cc730855(v=ws.10).aspx

    To enable HTTP 1.1 chunked transfer encoding for the World Wide Web publishing service, use the following syntax:

    appcmd set config /section:asp /enableChunkedEncoding:True|False

    True enables HTTP 1.1 chunked transfer encoding whereas False disables HTTP 1.1 chunked transfer encoding. The default value is True.

    We had the same problem, our solution: remove AddHeader "Content-Length"

提交回复
热议问题