Skip to content

IIS in-proc changes some responses from content-length to chunked #10773

Open

Description

@Tratcher

Converting Content-Length responses to Chunked is problematic as clients may be expecting that content-length value.

Frequently reproduces with:

            ctx.Request.Headers.ContentLength = ctx.Request.Path.Value.Length;
            await ctx.Response.WriteAsync(ctx.Request.Path.Value);
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Mon, 03 Jun 2019 16:13:19 GMT

2
/a

Reproduces less frequently with:

            ctx.Request.Headers.ContentLength = ctx.Request.Path.Value.Length;
            return ctx.Response.WriteAsync(ctx.Request.Path.Value);

@jkotalik

It's also known to change some auto-chunked responses to content-length, but that's less problematic as Content-Length is universally supported.

Activity

  1. added
    bug
    feature-iis
    on Jun 3, 2019
  2. kevinchalet commented on Jun 3, 2019

    @kevinchalet
    Contributor

    Could that be related to this old bug? #9139

  3. Tratcher commented on Jun 3, 2019

    @Tratcher
    MemberAuthor

    Perhaps, though I'm not setting a content-type.

  4. added this to the 3.0.0-preview8 milestone on Jun 18, 2019
  5. analogrelay commented on Jul 17, 2019

    @analogrelay
    Contributor

    Frequently reproduces with: ...
    Reproduces less frequently with: ...

    Umm... Am I not seeing how these two are different? They look identical to me.

  6. Tratcher commented on Jul 17, 2019

    @Tratcher
    MemberAuthor

    The response in this case should not have been compressable. It was also inconsistent and appeared to be timing related. The other issue was consistent and related to compression.

  7. Tratcher commented on Jul 17, 2019

    @Tratcher
    MemberAuthor

    Frequently reproduces with: ...
    Reproduces less frequently with: ...

    Umm... Am I not seeing how these two are different? They look identical to me.

    await vs return. This can affect the timing.

  8. shapeh commented on Apr 15, 2020

    @shapeh

    Hi, I was wondering if there are any news on this one?

  9. Tratcher commented on Apr 15, 2020

    @Tratcher
    MemberAuthor

    No, is it causing an issue for you?

  10. 4 remaining items

  11. davidfowl commented on Mar 28, 2021

    @davidfowl
    Member

    Does this still repro?

  12. shapeh commented on Mar 29, 2021

    @shapeh

    I haven't experienced this bug since 3.1. Currently on 5.0.
    I guess it has been fixed.

  13. jkotalik commented on Mar 29, 2021

    @jkotalik
    Contributor

    Hm, I don't think we actively fixed this in 3.1 or 5.0... may be worth verifying.

  14. added
    help wanted
    on Mar 29, 2021
  15. Tratcher commented on Mar 29, 2021

    @Tratcher
    MemberAuthor

    I could still reproduce it last time I tried, but I don't remember how long ago that was.

  16. davidfowl commented on Mar 29, 2021

    @davidfowl
    Member

    Marking as help wanted and good first issue.

  17. jkotalik commented on Mar 29, 2021

    @jkotalik
    Contributor

    Not sure if this is a good first issue, what would the suggested fix be? I believe IIS/HTTP.sys is the one deciding whether it should be chunked or content-length.

  18. Tratcher commented on Mar 29, 2021

    @Tratcher
    MemberAuthor

    It's something inside IIS, not Http.Sys.

  19. removed
    good first issue
    help wanted
    on Mar 29, 2021
  20. added
    area-networking
    and removed on Jun 2, 2023
  21. added theissue type on May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-fewarea-networkingbugfeature-iisseverity-major

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions