From 5d7f0bb32281704615c0199798130b72646ebd94 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 15 Apr 2025 16:19:55 +0100 Subject: [PATCH] proxy: drop text/event-stream requests otherwise the proxy will die on a hang --- src/core/Handler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/Handler.cpp b/src/core/Handler.cpp index c04c2ca..aebd212 100644 --- a/src/core/Handler.cpp +++ b/src/core/Handler.cpp @@ -391,6 +391,12 @@ void CServerHandler::proxyPass(const Pistache::Http::Request& req, Pistache::Htt continue; } + if (HNAME == "Accept" && req.headers().getRaw(h->name()).value().contains("text/event-stream")) { + Debug::log(ERR, "FIXME: text/event-stream not supported via the proxy (it would have to be async)"); + response.send(Pistache::Http::Code::Internal_Server_Error, "event-stream is not supported by checkpoint"); + return; + } + Debug::log(TRACE, "Header in: {}: {}", h->name(), req.headers().getRaw(h->name()).value()); builder.header(h); }