In 0.10.8, localstack/services/generic_proxy.py has regressed with respect to Connection header handling. HTTP headers are expected to be case insensitive.
In version 0.10.7 of generic_proxy.py:
if forward_headers.get('Connection', '').lower() != 'keep-alive':
self.close_connection = 1
in 0.10.8 this was changed to
if forward_headers.get('Connection') not in ['keep-alive', None]:
self.close_connection = 1
Note that the call to lower() was removed.
Keep case insensitive Connection header handling.
Case sensitive
Send a request with Connection: Keep-Alive
N/A
N/A
Thanks for reporting @bobtiernay-okta . This should be fixed in #2377 - can you please give it a try with the latest version of the Docker image? Please report here if the problem persists. Thanks!
@whummer I'm wondering about the logic:
connection_header = forward_headers.get('Connection') or ''
if connection_header.lower() not in ['keep-alive', '']:
self.close_connection = 1
Why are 'keep-alive', '' and None treated the same? Shouldn't this logic be the following instead?
if forward_headers.get('Connection', '').lower() == 'close':
self.close_connection = 1
or
if forward_headers.get('Connection', '').lower() != 'keep-alive':
self.close_connection = 1
?
@whummer Per your ask, I've validated the fix and it looks like it does help quite a bit with our vast set of integration tests that invoke LocalStack in parallel. I have a feeling a number of reported issues will benefit from these (at least those using the Java AWS SDK). Looking forward to the next release so that we can move forward from 0.10.7.
Most helpful comment
Thanks for reporting @bobtiernay-okta . This should be fixed in #2377 - can you please give it a try with the
latestversion of the Docker image? Please report here if the problem persists. Thanks!