Why doesn't IIS support chunked transfer encoding?

前端 未结 5 1049
一个人的身影
一个人的身影 2021-02-09 04:49

I am making an HTTP connection to an IIS web server and sending a POST request with the data encoded using Transfer-Encoding: chunked. When I do this, IIS simply closes the conn

相关标签:
5条回答
  • 2021-02-09 05:07

    My understanding is that chunked encoding can only be used in a HTTP response. A chunked request body would have the property of being incompatible with a 1.0 server, and in any case, there would be no way of a user-agent knowing that the server was a 1.0 server until it had already sent the request.

    But I agree it's unclear from the documentation.

    0 讨论(0)
  • 2021-02-09 05:10

    It goes both ways. try uploading a image 2MB++ to photobucket and record it. their uploader uploads chunked to their apache servers.

    0 讨论(0)
  • 2021-02-09 05:17

    This command came to rescue for me!

    C:\Windows\System32\Inetsrv\Appcmd.exe set config -section:httpCompression
    -[name='gzip'].staticCompressionLevel:9 -[name='gzip'].dynamicCompressionLevel:4

    saved my day... hope it helps someone like me!

    0 讨论(0)
  • 2021-02-09 05:23

    My only guess is they did not implement it out of concerns for security. In a naive solution it would be easy to set up a DOS attack by starting multiple chunked transfers that never end. And a complex solution which could account for the DOS attack is probably not worth the effort.

    Of course I cannot speak for Apache or IIS, you may be able to contact the Apache team directly though: http://httpd.apache.org/bug_report.html

    I agree with MarkR that I always thought chunked encoding could only be used as a response, but the documentation sure makes it sound like it can be used in a request or a response.

    0 讨论(0)
  • 2021-02-09 05:24

    Take a look at your client.

    Both IIS & Apache support POST requests using chunked transfer-encoding. You can verify this using the curl utility:

    curl <upload-url> --form "upfile=@<local_file>" --header "Transfer-Encoding: chunked"
    

    Verify the transfer is chunked using Wireshark

    0 讨论(0)
提交回复
热议问题