Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem getting host when running under http/2 #65

Open
garyd203 opened this issue Mar 2, 2022 · 0 comments
Open

Problem getting host when running under http/2 #65

garyd203 opened this issue Mar 2, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@garyd203
Copy link
Owner

garyd203 commented Mar 2, 2022

Using HTTP2 to an AWS ELBv2 in front of an ECS Service:

File "/opt/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 30, in coro
await self.app(scope, request.receive, send_stream.send)
File "/opt/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 55, in __call__
response = await self.dispatch_func(request, call_next)
File "/opt/venv/lib/python3.9/site-packages/xraysink/asgi/middleware.py", line 46, in xray_middleware
request.headers["host"].split(":", 1)[0], xray_recorder
File "/opt/venv/lib/python3.9/site-packages/starlette/datastructures.py", line 542, in __getitem__
raise KeyError(key)
KeyError: 'host'

Other dependencies

  • FastApi v0.70.0
  • uvicorn v0.17.4
  • no gunicorn

Research:

@garyd203 garyd203 added the bug Something isn't working label Mar 2, 2022
@garyd203 garyd203 changed the title Problem when running in FastAPI under http2 Problem when running under http 2 Mar 2, 2022
@garyd203 garyd203 changed the title Problem when running under http 2 Problem getting host when running under http 2 Mar 2, 2022
@garyd203 garyd203 changed the title Problem getting host when running under http 2 Problem getting host when running under http/2 Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant