From 515419e0a286d43beabc8b1d0a4cb9093b5518d2 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 6 Feb 2025 11:26:44 -0800 Subject: [PATCH] try to block serving node files --- app/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/__init__.py b/app/__init__.py index 54248bda0..f0654364c 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -372,6 +372,11 @@ def init_app(application): 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 {