Skip to content

Commit 6b658e8

Browse files
committed
Rebase changes
1 parent c781d67 commit 6b658e8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

starlette/responses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
345345
http_if_range = headers.get("if-range")
346346

347347
if http_range is None or (http_if_range is not None and not self._should_use_range(http_if_range, stat_result)):
348-
await self._handle_simple(send, send_header_only)
348+
await self._handle_simple(scope, send, send_header_only)
349349
else:
350350
try:
351351
ranges = self._parse_range_header(http_range, stat_result.st_size)
@@ -364,7 +364,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
364364
if self.background is not None:
365365
await self.background()
366366

367-
async def _handle_simple(self, send: Send, send_header_only: bool) -> None:
367+
async def _handle_simple(self, scope: Scope, send: Send, send_header_only: bool) -> None:
368368
await send({"type": "http.response.start", "status": self.status_code, "headers": self.raw_headers})
369369
if send_header_only:
370370
await send({"type": "http.response.body", "body": b"", "more_body": False})

tests/middleware/test_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,7 @@ async def passthrough(request: Request, call_next: RequestResponseEndpoint) -> R
11811181
"version": "3",
11821182
"method": "GET",
11831183
"path": "/",
1184+
"headers": [],
11841185
"extensions": {"http.response.pathsend": {}},
11851186
}
11861187

tests/test_responses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ async def send(message: Message) -> None:
362362

363363
# Since the TestClient doesn't support `pathsend`, we need to test this directly.
364364
await app(
365-
{"type": "http", "method": "get", "extensions": {"http.response.pathsend": {}}},
365+
{"type": "http", "method": "get", "headers": [], "extensions": {"http.response.pathsend": {}}},
366366
receive,
367367
send,
368368
)

0 commit comments

Comments
 (0)