Transfer-Encoding = "chunked" header for a Response Status 204 No Content violating F5 load balance rules resulting in endpoint transaction failure

ps-rizwan 21 Reputation points
2022-08-18T07:09:16.363+00:00

While assisting our customer, we found that when a browser agent makes a request to the application endpoint “/keepalive” it returns a Response Status 204 (No Content) and has a header Transfer-Encoding = “chunked”. As the response is not having a body and a header Transfer-Encoding = “chunked” it is causing the request to be terminated at the load balancer F5 level.

RFC 7231 - A 204 response is terminated by the first empty line after the header field because it cannot contain the message body.
RFC 7230 - A server MUST NOT send a Transfer-Encoding header field in any response with a status code of 1xx (Informational) or 204 (No Content)

This is leading to a response not being received by the client and the browser agent becoming unresponsive.

The legacy application is hosted under IIS 10 on a Windows Server 2016 machine. It is observed that the Transfer-Encoding = “chunked” is added by the IIS and not by the application. Is there a way we can disable adding the header Transfer-Encoding = ”chunked” for the application /keepalive request having a response status code of 204?

232250-iissupport.png

Internet Information Services
{count} votes

2 answers

Sort by: Most helpful
  1. Yurong Dai-MSFT 2,821 Reputation points Microsoft Vendor
    2022-08-19T06:53:09.963+00:00

    Hi @ps-rizwan ,

    To enable chunked transfer encoding, you need to set the value of AspEnableChunkedEncoding to "True" in the metabase of the site, server, or virtual directory for which chunked transfer encoding is enabled. By default this value is set to "True", you can try to change the value to "False" to disable it.

    1. Open a command prompt.
    2. Change to the Inetpub\Adminscripts folder.
    3. Run the following: cscript adsutil.vbs set /W3SVC/AspEnableChunkedEncoding "TRUE"

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread.

    Best regards,

    Yurong Dai


  2. ps-rizwan 21 Reputation points
    2022-08-19T20:26:00.98+00:00

    Disabling the AspEnableChunkedEncoding didn't work for the website.

    Applying the URL rewrite rule to update the Transfer-Encoding response header fixed the issue.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.