Use pathlib for path resolution (#2506)
This commit is contained in:
@@ -616,8 +616,11 @@ def test_dotted_dir_ok(
|
||||
def test_breakout(app: Sanic, static_file_directory: str):
|
||||
app.static("/foo", static_file_directory)
|
||||
|
||||
_, response = app.test_client.get("/foo/..%2Ffake/server.py")
|
||||
assert response.status == 404
|
||||
|
||||
_, response = app.test_client.get("/foo/..%2Fstatic/test.file")
|
||||
assert response.status == 400
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
@@ -629,6 +632,6 @@ def test_double_backslash_prohibited_on_win32(
|
||||
app.static("/foo", static_file_directory)
|
||||
|
||||
_, response = app.test_client.get("/foo/static/..\\static/test.file")
|
||||
assert response.status == 400
|
||||
assert response.status == 404
|
||||
_, response = app.test_client.get("/foo/static\\../static/test.file")
|
||||
assert response.status == 400
|
||||
assert response.status == 404
|
||||
|
||||
Reference in New Issue
Block a user