Changes between Initial Version and Version 1 of Ticket #36293, comment 7


Ignore:
Timestamp:
Apr 7, 2025, 5:49:01 AM (6 months ago)
Author:
Carlton Gibson

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36293, comment 7

    initial v1  
    55You should then be able to set the [https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding `identity` content encoding] before sending the response to bypass the middleware here.
    66
     7
     8The [https://www.rfc-editor.org/rfc/rfc2616#section-3.5 RFC] has this:
     9
     10> The default (identity) encoding; the use of no transformation whatsoever. This content-coding is used only in the Accept-Encoding header, and SHOULD NOT be used in the Content-Encoding header.
     11
     12So you might want to strip that header in a subsequent middleware (but compare the MUST in [https://www.rfc-editor.org/rfc/rfc2616#section-14.11 section 14.11])
     13
     14I think we could consider adding a check here:
     15
     16        # Avoid gzipping if we've already got a content-encoding.
     17        if response.has_header("Content-Encoding"):
     18            # POSSIBLE ADDITION: remove header if response["Content-Encoding"] == "identity" here.
     19            return response
     20
     21With a line in the docs to make this explicit.
     22
     23
Back to Top