Conform to RFC3986 - do not include url fragments in requests#1174
Conform to RFC3986 - do not include url fragments in requests#1174asvetlov merged 2 commits intoaio-libs:masterfrom bmuller:master
Conversation
Current coverage is 98.40% (diff: 100%)@@ master #1174 diff @@
==========================================
Files 29 29
Lines 6514 6515 +1
Methods 0 0
Messages 0 0
Branches 1092 1092
==========================================
+ Hits 6410 6411 +1
Misses 54 54
Partials 50 50
|
|
As an example of why this is needed, right now import aiohttp
import asyncio
async def fetch(url):
async with aiohttp.ClientSession() as session:
async with session.get(url) as resp:
print(resp.history)
url = "http://best-of-tumblr.tumblr.com/post/150420362886"
asyncio.get_event_loop().run_until_complete(fetch(url))The history that's output is just a list |
asvetlov
left a comment
There was a problem hiding this comment.
Cool!
We already drop fragments on server side redirection, supporting the feature on client is very important addition.
Please add yourself to CONTRIBUTORS.txt and file a new entry to CHANGES.rst
|
Done! Let me know if you need anything else. |
|
Nothing more -- your PR is very clean and obvious. |
|
Thanks so much for the quick turnaround! |
What do these changes do?
This strips fragments from URLs before making requests. This is the behavior of all major browsers and is described in RFC3986 Section 3.5.
Are there changes in behavior for the user?
Nope.
Related issue number
None.
Checklist
CONTRIBUTORS.txtCHANGES.rst#isuue_numberformat at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.