Skip to content

Commit

Permalink
Fix test_gzip_ignored_for_responses_with_encoding_set w/ brotli (#1962)
Browse files Browse the repository at this point in the history
Closes #1597
  • Loading branch information
mgorny committed Nov 23, 2022
1 parent 549345e commit 88e9fc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/middleware/test_gzip.py
Expand Up @@ -86,7 +86,7 @@ async def generator(bytes, count):

streaming = generator(bytes=b"x" * 400, count=10)
return StreamingResponse(
streaming, status_code=200, headers={"Content-Encoding": "br"}
streaming, status_code=200, headers={"Content-Encoding": "text"}
)

app = Starlette(
Expand All @@ -95,8 +95,8 @@ async def generator(bytes, count):
)

client = test_client_factory(app)
response = client.get("/", headers={"accept-encoding": "gzip, br"})
response = client.get("/", headers={"accept-encoding": "gzip, text"})
assert response.status_code == 200
assert response.text == "x" * 4000
assert response.headers["Content-Encoding"] == "br"
assert response.headers["Content-Encoding"] == "text"
assert "Content-Length" not in response.headers

0 comments on commit 88e9fc1

Please sign in to comment.