-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
bpo-36522: Print all values for headers with multiple values #12681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-36522: Print all values for headers with multiple values #12681
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
Just signed the CLA and added a NEWS entry. |
Thanks @houglum for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Thank you for your contribution @houglum! |
GH-12682 is a backport of this pull request to the 3.7 branch. |
…GH-12681) (cherry picked from commit 461c416) Co-authored-by: Matt Houglum <[email protected]>
…) (GH-12682) (cherry picked from commit 461c416) Co-authored-by: Matt Houglum <[email protected]>
This is a follow-up to https://bugs.python.org/issue33365. The fix for that issue (see #6611) added a statement to also print header values, but it does not account for the case where multiple values exist for the same header name (note that multiple header values for the same header name can be supplied in one comma-separated entry, or in multiple entries; see this StackOverflow post). E.g. if my response contained these headers:
then the debug output would print whichever of those values is returned from
self.headers.get("x-goog-hash")
for both prints:This PR changes the header iteration to use
self.headers.items()
instead, which will return the key and value pair to be printed, resulting in the correct debug output:https://bugs.python.org/issue36522