summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsyeopite <syeopite@syeopite.dev>2025-01-22 11:30:45 -0800
committersyeopite <syeopite@syeopite.dev>2025-01-22 11:30:45 -0800
commitdc38bcdf1783fcde79a3eca3c9f92cf0f9d55d13 (patch)
tree82f303468857c61b0081579f06eaa79cb6ff510c /src
parentd5442d45bc38630142184d5a6c32468e8828aff9 (diff)
parent7a15318fbcc44d7f7b2f5795023fcc36b5e122a3 (diff)
downloadinvidious-dc38bcdf1783fcde79a3eca3c9f92cf0f9d55d13.tar.gz
invidious-dc38bcdf1783fcde79a3eca3c9f92cf0f9d55d13.tar.bz2
invidious-dc38bcdf1783fcde79a3eca3c9f92cf0f9d55d13.zip
Kemal: Skip route if response was closed by handlers (#5073)
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/handlers.cr1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/invidious/helpers/handlers.cr b/src/invidious/helpers/handlers.cr
index f3e3b951..13ea9fe9 100644
--- a/src/invidious/helpers/handlers.cr
+++ b/src/invidious/helpers/handlers.cr
@@ -27,6 +27,7 @@ class Kemal::RouteHandler
# Processes the route if it's a match. Otherwise renders 404.
private def process_request(context)
raise Kemal::Exceptions::RouteNotFound.new(context) unless context.route_found?
+ return if context.response.closed?
content = context.route.handler.call(context)
if !Kemal.config.error_handlers.empty? && Kemal.config.error_handlers.has_key?(context.response.status_code) && exclude_match?(context)