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

Added Link header (RFC8288) parsing #2955

Merged
merged 6 commits into from
Apr 25, 2018
Merged

Added Link header (RFC8288) parsing #2955

merged 6 commits into from
Apr 25, 2018

Conversation

hdk5
Copy link
Contributor

@hdk5 hdk5 commented Apr 24, 2018

What do these changes do?

Added and links property for ClientResponse object.

links parses Link header into a dict.
Dict keys are rel link params or url itself as string.
Values are dicts of link params and url as yarl URL object

Look also RFC 8288

Are there changes in behavior for the user?

New properties added, no backward incompatible changes

Related issue number

#2948

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
  • Add a new news fragment into the CHANGES folder

@codecov-io
Copy link

codecov-io commented Apr 24, 2018

Codecov Report

Merging #2955 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2955      +/-   ##
==========================================
+ Coverage   97.99%   97.99%   +<.01%     
==========================================
  Files          40       40              
  Lines        7523     7539      +16     
  Branches     1318     1321       +3     
==========================================
+ Hits         7372     7388      +16     
  Misses         48       48              
  Partials      103      103
Impacted Files Coverage Δ
aiohttp/client_reqrep.py 97.35% <100%> (+0.07%) ⬆️

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 bc36b8c...6066206. Read the comment docs.

@asvetlov
Copy link
Member

  1. No need for raw_links, use MultiDict for links instead.
  2. Use immutable MappingProxyType as .links item value.
  3. Add a test for quoted attr, e.g. Link: <http://example.com>; rel="rel-type", it is a valid case.

@asvetlov
Copy link
Member

By spec the link could be relative (/path/to), need to join with base in this case.

@asvetlov asvetlov merged commit 90da78e into aio-libs:master Apr 25, 2018
@asvetlov
Copy link
Member

Thanks!

@daniel-j-h
Copy link

Sweet that was fast, thanks @hdk5! 🙇

thehesiod pushed a commit to thehesiod-forks/aiohttp that referenced this pull request Apr 26, 2018
@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot:chronographer:provided There is a change note present in this PR outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants