Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion uvicorn/protocols/http/h11_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,14 @@ def __init__(
# ASGI exception wrapper
async def run_asgi(self, app: ASGI3Application) -> None:
try:
# asgi apps can manipulate the scope, make sure we don't get a manipulated scope
# this can lead to problems when e.g. the headers are exchanged by an iterator
result = await app( # type: ignore[func-returns-value]
self.scope, self.receive, self.send
# asgi apps can manipulate the scope, make sure we don't get a manipulated scope
# this can lead to problems when e.g. the headers are exchanged by an iterator
self.scope.copy(),
self.receive,
self.send,
)
except BaseException as exc:
msg = "Exception in ASGI application\n"
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/protocols/http/httptools_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def __init__(
async def run_asgi(self, app: ASGI3Application) -> None:
try:
result = await app( # type: ignore[func-returns-value]
self.scope, self.receive, self.send
self.scope.copy(), self.receive, self.send
)
except BaseException as exc:
msg = "Exception in ASGI application\n"
Expand Down
Loading