question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
Tratchercommented, Jul 17, 2019

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.

0reactions
Tratchercommented, Mar 29, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found