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

Fix parse_header_links on empty header #4245

Merged
merged 3 commits into from
Aug 17, 2017
Merged

Fix parse_header_links on empty header #4245

merged 3 commits into from
Aug 17, 2017

Conversation

remram44
Copy link
Contributor

When receiving an empty Link: header, one bogus entry was returned anyway. This breaks some applications.

I agree that web servers shouldn't be sending those but they do so here we are. Also fixes docstring with proper return type.

Fixes halcy/Mastodon.py#74

@codecov-io
Copy link

codecov-io commented Aug 17, 2017

Codecov Report

Merging #4245 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4245      +/-   ##
==========================================
+ Coverage   88.65%   88.66%   +0.01%     
==========================================
  Files          18       18              
  Lines        2018     2021       +3     
==========================================
+ Hits         1789     1792       +3     
  Misses        229      229
Impacted Files Coverage Δ
requests/utils.py 82.87% <100%> (+0.12%) ⬆️

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 af9dd61...8e411d0. Read the comment docs.

Copy link
Member

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Thanks for this, this is a good change! Can we get some tests and an entry in HISTORY.rst please?

@remram44
Copy link
Contributor Author

Sure thing!

Copy link
Member

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Beautiful, thank you so much!

@Lukasa Lukasa merged commit 554a210 into psf:master Aug 17, 2017
@Lukasa
Copy link
Member

Lukasa commented Aug 17, 2017

Congratulations on your first Requests contribution! ✨🍰✨

@remram44
Copy link
Contributor Author

You guys are very friendly. Thanks for the kind words. I'll try to patch the bogus server as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parsing response's "link" headers can fail
3 participants