Skip to content

Commit

Permalink
try to block serving node files
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Kehl committed Feb 6, 2025
1 parent d16eb70 commit 515419e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ def record_start_time():
g.start = monotonic()
g.endpoint = request.endpoint

@application.before_request
def block_serving_node_files():
if "node_modules" in request.path:
abort(403)

@application.context_processor
def inject_global_template_variables():
return {
Expand Down

0 comments on commit 515419e

Please sign in to comment.