Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.7k
Comments
✅ Enable test case for duplicated headers intest_tutorial/test_header_params/test_tutorial003.py#13864
Conversation
…include multiple `x-token` values
Amogha-ark commentedJul 5, 2025
Hi, I see the PR is failing because of a missing label. I don’t have permission to add it — can someone from the team help with that? Thank you!” |
isgin01 commentedJul 5, 2025
Thanks for this PR. For reference, you might want to include relevant links next timehttps://www.rfc-editor.org/rfc/rfc9110.html#section-5.3-1 |
test_tutorial003.pytest_tutorial003.pytest_tutorial003.pytest_tutorial003.pytest_tutorial003.pytest_tutorial/test_header_params/test_tutorial003.py
YuriiMotov left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This test case covers the use-case described in docs:Duplicate headers.
Don't see anything wrong in enabling it
tiangolo left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This was probably failing at some point 🤔 Thanks! ☕
5fef4d1 intofastapi:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Add test coverage for multiple header values in TestClient
Summary
This PR adds test coverage for multiple header values passed as a list of tuples to FastAPI's TestClient, resolving a long-standing TODO comment in the test suite.
Background
The test file tests/test_tutorial/test_header_params/test_tutorial003.py contained a commented-out test case with a TODO comment questioning whether multiple header values were working correctly:
Technical Details
When multiple headers with the same name are passed as a list of tuples like [("x-token", "foo"), ("x-token", "bar")], FastAPI correctly processes them as a list of values ["foo", "bar"]. This is the expected HTTP behavior for multiple headers with the same name.
Type of Change:
Checklist: