You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adev runserver doesn't respect the host setting - it always uses 0.0.0.0 which means the server can be always accused from any computer on the network.
Steps to reproduce
create a file test.py
from aiohttp import web
class Main:
def __init__(self):
self.app = web.Application()
self.app.router.add_get('/', self.handle_request)
async def handle_request(self, request):
return web.Response(text="testing", content_type='text/html')
def get_app():
page = Main()
return page.app
and run command adev runserver test.py --host localhost
As expected we can access the page from the computer it is running on. However it is also possible to access the page from any other computer on the network, which (according to my understanding) shouldn't be possible with this host setting.
If this is indeed and issue then I suspect its because of using HOST instead of host here:
I'm not really sure how well that works, or if it's worth changing it. We could probably add a new option for setting the binding address, or maybe repurpose this option. Feel free to give it a go.
aiohttp-devtools version: 1.0.post0
aiohttp version: 3.8.1
python version: 3.10
Platform: mac
Issue Summary
adev runserver
doesn't respect the host setting - it always uses0.0.0.0
which means the server can be always accused from any computer on the network.Steps to reproduce
create a file
test.py
and run command
adev runserver test.py --host localhost
As expected we can access the page from the computer it is running on. However it is also possible to access the page from any other computer on the network, which (according to my understanding) shouldn't be possible with this host setting.
If this is indeed and issue then I suspect its because of using
HOST
instead ofhost
here:aiohttp-devtools/aiohttp_devtools/runserver/main.py
Line 65 in 3e517d2
If it is not an issue how could I restrict the dev server to only be accessible from localhost?
The text was updated successfully, but these errors were encountered: