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?
to your account
Describe the bug
When serving a static file named a../b.txt with app.static(), the Sanic request handler gives a 400 status code instead of 200.
First file is called main.py.
from sanic import Sanic
app = Sanic(name="sanic_test")
if __name__ == "__main__":
Then, make the file in question:
mkdir -p static_files/a../
cat "hello world" > static_files/a../b.txt
And run the server with python main.py, followed by a GET request.
$ curl http://localhost:8000/static/a../b.txt
⚠️ 400 — Bad Request
The app.static() handler should serve the b.txt file with a 200 response code.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.
Sorry, something went wrong.
This has been solved in the previous PRs. Feel free to reopen if there is still an issue.
Tested and is no longer reproducible.
No branches or pull requests