-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conform to RFC3986 - do not include url fragments in requests #1174
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.txt
CHANGES.rst
#isuue_number
format at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.