-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
Describe the bug
Wrong value of Request.rel_url.raw_path when request was made with url in absolute form
To Reproduce
- Make a simple server app with logging hook
from aiohttp import web
async def log(request, response):
print('rel_url:', request.rel_url)
print('raw_path:', request.rel_url.raw_path)
async def hello(request):
return web.Response(text="Hello, world")
app = web.Application()
app.add_routes([web.get('/test', hello)])
app.on_response_prepare.append(log)
web.run_app(app, host='127.0.0.1', port=3322)
- Make a request using relative form of url:
echo -e "GET /test HTTP/1.1\r\n\r\n" | nc -N 127.0.0.1 3322 - Make a request using absolute form of url:
echo -e "GET http://aaa.com/test HTTP/1.1\r\n\r\n" | nc -N 127.0.0.1 3322
Expected behavior
Server logs the "raw_path" as /test in both cases
Logs/tracebacks
aiohttp==3.8.0
rel_url: /test
raw_path: /test
rel_url: http://abc.com/test
raw_path: http://abc.com/testaiohttp==3.7.4
rel_url: /test
raw_path: /test
rel_url: http://abc.com/test
raw_path: /testPython Version
Python 3.8.7aiohttp Version
aiohttp==3.8.0multidict Version
multidict==5.2.0yarl Version
yarl==1.7.2OS
Ubuntu 18.04
Related component
Server
Additional context
No response
Code of Conduct
- I agree to follow the aio-libs Code of Conduct