Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

✅ Enable test case for duplicated headers intest_tutorial/test_header_params/test_tutorial003.py#13864

Merged
tiangolo merged 3 commits intofastapi:masterfrom
Amogha-ark:fix-multiple-header-values-test
Sep 20, 2025
Merged

✅ Enable test case for duplicated headers intest_tutorial/test_header_params/test_tutorial003.py#13864
tiangolo merged 3 commits intofastapi:masterfrom
Amogha-ark:fix-multiple-header-values-test

Conversation

@Amogha-ark
Copy link
Contributor

@Amogha-arkAmogha-ark commentedJul 5, 2025
edited
Loading

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:

  • Bug fix
  • Test coverage improvement
  • New feature
  • Breaking change
  • Documentation update

Checklist:

  • Tests pass locally
  • No breaking changes
  • Code follows project style guidelines
  • Self-review completed

@Amogha-ark
Copy link
ContributorAuthor

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
Copy link

This is the expected HTTP behavior for multiple headers with the same name.

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

Amogha-ark reacted with thumbs up emoji

@Amogha-arkAmogha-ark changed the title✨ Update test case for header parameters intest_tutorial003.pyUpdate test case for header parameters intest_tutorial003.pyJul 6, 2025
@Amogha-arkAmogha-ark reopened thisJul 6, 2025
@Amogha-arkAmogha-ark changed the titleUpdate test case for header parameters intest_tutorial003.pyAdd test case for header parameters intest_tutorial003.pyJul 6, 2025
@YuriiMotovYuriiMotov changed the titleAdd test case for header parameters intest_tutorial003.py✅ Enable test case for duplicated headers intest_tutorial/test_header_params/test_tutorial003.pyJul 6, 2025
Copy link
Member

@YuriiMotovYuriiMotov left a 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

Amogha-ark reacted with thumbs up emoji
Copy link
Member

@tiangolotiangolo left a 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! ☕

@tiangolotiangolo merged commit5fef4d1 intofastapi:masterSep 20, 2025
28 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tiangolotiangolotiangolo approved these changes

@YuriiMotovYuriiMotovYuriiMotov approved these changes

+1 more reviewer

@isgin01isgin01isgin01 approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@Amogha-ark@isgin01@tiangolo@YuriiMotov@amogha-raok

[8]ページ先頭

©2009-2026 Movatter.jp