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

Remove fragment string in request path #846

Closed

Conversation

carlcarl
Copy link
Contributor

@carlcarl carlcarl commented Apr 9, 2016

What these changes does?

It remove the fragment string begin with # in request.path.
This should not be sent to the server with the url

The request.url still keeps the original format.

How to test your changes?

Sample code:

import asyncio
import aiohttp

async def test_request():
    with aiohttp.ClientSession() as session:
        async with session.get('http://127.0.0.1:8000/test#123') as resp:
            print(resp)

loop = asyncio.get_event_loop()
loop.run_until_complete(test_request())
  1. Run a local server first: python3 -m http.server
  2. Run the sample code above.
  3. Check the message of the server, original will be 127.0.0.1 - - ... "GET /test#123 HTTP/1.1" 404 -, fixed will be 127.0.0.1 - - ... "GET /test HTTP/1.1" 404 -

Related issue number

#824

Checklist

  • Code is written and well
  • Tests for the changes are provided
  • Documentation reflects the changes

The request path should not include the # fragment.
The request url can still keep this.
@carlcarl carlcarl changed the title Remove sharp sign in request path Remove fragment string in request path Apr 22, 2016
@carlcarl
Copy link
Contributor Author

Any suggestion?

@asvetlov asvetlov closed this Jul 22, 2016
@avamsi avamsi mentioned this pull request Aug 27, 2016
asvetlov added a commit that referenced this pull request Aug 27, 2016
@asvetlov
Copy link
Member

@carlcarl sorry, you PR was closed accidentally by base branch removing.
I cannot reopen the PR but merged it manually by 01057dc.
Thank you very much for contribution.

@asvetlov asvetlov mentioned this pull request Oct 15, 2016
@lock
Copy link

lock bot commented Oct 29, 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.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants