Merge "Do not send compression as acceptable encoding"

This commit is contained in:
Zuul 2022-08-10 11:32:31 +00:00 committed by Gerrit Code Review
commit 19831b61f9
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,16 @@
---
fixes:
- |
Fixes unreliable behavior with ETag interactions with some BMCs as
opportunistic use of compressed responses may cause the BMC to change
an ETag response to "Weak", which is to be expected as an ETag represents
an absolute byte-by-byte response consistency, and compression cannot
reliably honor that contract. Introduction of a client perceiving a
"Weak" ETag may not be expected by the server, and the server may reject
responses because the ETag is not a "Strong" ETag when we respond or
interact with a resource.
As a result, requests no longer offer oppurtunistic compression
of responses as an acceptable possibility, which overall has minimal
impact, espescially when compared to the value of consistent BMC
behavior and interaction.

View File

@ -50,6 +50,15 @@ class Connector(object):
# By default, we ask HTTP server to shut down HTTP connection we've
# just used.
self._session.headers['Connection'] = 'close'
# NOTE(TheJulia): Depending on the BMC, offering compression as an
# acceptable response changes the ETag behavior to offering an
# automatic "weak" ETag response, which is appropriate because the
# body content *may* not be a byte for byte match given compression.
# Overall, the value of compression is less than the value of concise
# interaction with the BMC. Setting to identity basically means
# "without modification or compression". By default, python-requests
# indicates responses can be compressed.
self._session.headers['Accept-Encoding'] = 'identity'
if username or password:
LOG.warning('Passing username and password to Connector is '