Skip to content

Conversation

@jkotalik
Copy link
Contributor

@jkotalik jkotalik commented Dec 4, 2018

For #4398

@muratg @Eilon for patch consideration.

Description:

Today, when and HTTP/2 request is sent to ANCM Inprocess, on a 204 response, IIS will add the header "transfer-encoding"="chunked". This is an invalid response and HTTP.Sys aborts the response with HTTP_1_1_REQUIRED. Web browsers like chrome explicitly show the error HTTP_1_1_REQUIRED when returning a 204. Other browser still have the issue, but they retry a HTTP/1.1 request afterwards.

This means that all HTTP responses which:

  • Set a status code of 204
  • Use HTTPS
  • Support HTTP/2

will explicitly fail in chrome and silently fail/retry in other browsers.

Customer Impact

If customers want to use the 204 response code, they will have to add a middleware to set ContentLength=0 on responses with status code 204.

For example:

app.Use(async (ctx, next) =>
{
  await next();
  if (ctx.Response.StatusCode == 204)
  {
    ctx.Response.ContentLength = 0;
  }
});

Regression?

Regression from all of our server behavior (Kestrel, ANCM + Kestrel).

Risk:

Low. The change only affects 204, 205, and 304 status code responses, which aren't allowed to have a body anyways. This change only sets a bool to false on flush, which is checked when IIS is determining if it should set the encoding to chunked or not.

@muratg muratg added the Servicing-consider Shiproom approval is required for the issue label Dec 4, 2018
@muratg muratg added this to the 2.2.1 milestone Dec 4, 2018
Copy link
Contributor

@natemcmaster natemcmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving from an infrastructure-only perspective. The IISIntegration group of projects is already patching in 2.2.1, so no additional infrastructure changes are needed.

@muratg muratg added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Dec 5, 2018
@jkotalik jkotalik merged commit 0646bb9 into release/2.2 Dec 5, 2018
@jkotalik jkotalik deleted the jkotalik/204Response22 branch December 5, 2018 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants