I’m deploying a python container to AWS ECS Fargate and recognizing a different behavior than executing the container locally, and I absolutely have no idea why.
Two differences I recognized:
- I tried to detect if a request is a WebSocket request with the following snippet
if req_headers['connection'] == 'Upgrade' and req_headers['upgrade'] == 'websocket':
This one I can execute local successfully, but in AWS I get
- I changed the same functionality to the following:
def __is_web_socket_request(self, headers): return 'connection' in headers and headers['connection'] == 'Upgrade' and 'upgrade' in headers and headers['upgrade'] == 'websocket'
Locally again everything works as expected, but in AWS it’s not working because the Headers starts with a upper-case letter – so weird!
The Dockerfile uses the base image:
Do I miss something completely, or why does this weir behavior happen?