Sanic: what have done to static.py?

Created on 17 Apr 2017  路  3Comments  路  Source: sanic-org/sanic

On last Friday,everything is ok,my static file test works fine.

Today,when I pip install sanic==0.5.1
It raise 404 error.

when I pip install sanic==0.5.0
everything is ok again.

seems like the code blow has some problem?
if not file_path.startswith(root_path):
raise FileNotFound('File not found',
path=file_or_directory,
relative_url=file_uri)

Most helpful comment

It probably has something to do with #635

All 3 comments

Can you please include the code to reproduce this?

@r0fls
from sanic import Sanic
app = Sanic(__name__)
app.static('/st/index.html', './client/index.html')
app.static('/static', './client')

app.run(host="0.0.0.0", port=8000)

when in sanic 0.5.0,no matter
wget localhost:8000/static/index.html
or
wget localhost:8000/st/index.html
is ok.

but when I install pip install sanic == 0.5.1
both wget get 404.

thank you.

allwrong

It probably has something to do with #635

Was this page helpful?
0 / 5 - 0 ratings