Display standard http error instead of exception on path security error
This commit is contained in:
parent
e1fdb90da6
commit
c7a8a3933e
1 changed files with 1 additions and 1 deletions
|
@ -85,7 +85,7 @@ class UiRequest(object):
|
||||||
# Sanitize request url
|
# Sanitize request url
|
||||||
path = path.replace("\\", "/")
|
path = path.replace("\\", "/")
|
||||||
if "../" in path or "./" in path:
|
if "../" in path or "./" in path:
|
||||||
raise SecurityError("Invalid path")
|
return self.error403("Invalid path: %s" % path)
|
||||||
|
|
||||||
if self.env["REQUEST_METHOD"] == "OPTIONS":
|
if self.env["REQUEST_METHOD"] == "OPTIONS":
|
||||||
if "/" not in path.strip("/"):
|
if "/" not in path.strip("/"):
|
||||||
|
|
Loading…
Reference in a new issue