Skip to content
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

Preserve individual headers with the same name on responses #1208

Merged
merged 5 commits into from Nov 24, 2021

Conversation

isidentical
Copy link
Contributor

Resolves #1207

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2021

Codecov Report

Merging #1208 (47311d1) into master (4d7d6b6) will decrease coverage by 0.49%.
The diff coverage is 94.32%.

❗ Current head 47311d1 differs from pull request most recent head b0c55b0. Consider uploading reports for the commit b0c55b0 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1208      +/-   ##
==========================================
- Coverage   97.28%   96.78%   -0.50%     
==========================================
  Files          67       72       +5     
  Lines        4235     4637     +402     
==========================================
+ Hits         4120     4488     +368     
- Misses        115      149      +34     
Impacted Files Coverage Δ
tests/test_auth.py 100.00% <ø> (ø)
tests/test_binary.py 100.00% <ø> (ø)
httpie/compat.py 16.66% <9.09%> (-83.34%) ⬇️
tests/conftest.py 76.47% <54.54%> (-10.49%) ⬇️
tests/test_ssl.py 91.01% <63.63%> (-3.93%) ⬇️
httpie/models.py 95.31% <75.00%> (-2.06%) ⬇️
httpie/output/formatters/colors.py 92.66% <83.33%> (-0.92%) ⬇️
tests/utils/http_server.py 97.14% <97.14%> (ø)
httpie/__init__.py 100.00% <100.00%> (ø)
httpie/adapters.py 100.00% <100.00%> (ø)
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06d9c14...b0c55b0. Read the comment docs.


response = super().build_response(req, resp)
response.headers = HTTPHeadersDict(getattr(resp, "headers", {}))
return response
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking about moving httpie/ssl.py into httpie/adapters.py, since it does make sense for all the adapters to be in the same place. WDYT @jakubroztocil?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍🏻

tests/utils/http_server.py Outdated Show resolved Hide resolved
tests/utils/http_server.py Outdated Show resolved Hide resolved
httpie/adapters.py Outdated Show resolved Hide resolved
@jkbrzt jkbrzt merged commit c000886 into httpie:master Nov 24, 2021
@isidentical isidentical deleted the response-headers-concat branch December 8, 2021 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Response headers sharing the same names get converted into a comma-separated list
3 participants