dotnet / dotnet/aspnetcore

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

Open
#10,773 15 comments 0 reactions 0 assignees View on GitHub
affected-few area-networking bug feature-iis severity-major
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.