Limits the permissible Accept-Encoding values, based on what we can decode appropriately.
(self)
| 918 | self.headers["accept-encoding"] = "identity" |
| 919 | |
| 920 | def constrain_encoding(self) -> None: |
| 921 | """ |
| 922 | Limits the permissible Accept-Encoding values, based on what we can decode appropriately. |
| 923 | """ |
| 924 | accept_encoding = self.headers.get("accept-encoding") |
| 925 | if accept_encoding: |
| 926 | self.headers["accept-encoding"] = ", ".join( |
| 927 | e |
| 928 | for e in {"gzip", "identity", "deflate", "br", "zstd"} |
| 929 | if e in accept_encoding |
| 930 | ) |
| 931 | |
| 932 | def _get_urlencoded_form(self): |
| 933 | is_valid_content_type = ( |