Skip to content

Commit

Permalink
improved HTTPNotFound messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Barakudum committed Mar 5, 2024
1 parent caca752 commit c326856
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jarklin/web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def files(resource: str):
root = p.abspath(os.getcwd())
fp = p.abspath(p.join(root, resource))
if fp in app.config['EXCLUDE']:
raise HTTPNotFound()
raise HTTPNotFound(resource)
if p.commonpath([root, fp]) != root:
raise HTTPNotFound(f"{fp!s}")
raise HTTPNotFound(resource)

if attempt_optimization and flask.current_app.config['JIT_OPTIMIZATION']:
try:
Expand Down

0 comments on commit c326856

Please sign in to comment.