From 6226a05fe3aac7bacc4ffc2f14cc3e133b6157eb Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 6 Sep 2018 13:36:54 +0200 Subject: [PATCH] Fix incorrect sending of HTTP error response through Websocket connections. --- src/output/output_http.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/output/output_http.cpp b/src/output/output_http.cpp index a4e35978..709c864b 100644 --- a/src/output/output_http.cpp +++ b/src/output/output_http.cpp @@ -43,9 +43,11 @@ namespace Mist { } void HTTPOutput::onFail(){ - H.Clean(); //make sure no parts of old requests are left in any buffers - H.SetBody("Stream not found. Sorry, we tried."); - H.SendResponse("404", "Stream not found", myConn); + if (!webSock){ + H.Clean(); //make sure no parts of old requests are left in any buffers + H.SetBody("Stream not found. Sorry, we tried."); + H.SendResponse("404", "Stream not found", myConn); + } Output::onFail(); }