From 4d06180041a1d298b7833636619e72123201ec3b Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Sat, 26 Jan 2019 21:55:24 +0100 Subject: [PATCH] Move mark from WebSockets down to HTTP --- src/App.h | 8 ++------ src/HttpResponse.h | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/App.h b/src/App.h index efb78e5..21800b7 100644 --- a/src/App.h +++ b/src/App.h @@ -55,10 +55,6 @@ public: httpContext->filter(std::move(filterHandler)); } - void registerTag() { - - } - ~TemplatedApp() { /* Let's just put everything here */ if (httpContext) { @@ -179,8 +175,8 @@ public: } } - /* Add mark, we don't want to end anything */ - res->writeHeader("WebSocket-Server", "uWebSockets")->end(); + /* This will add our mark */ + res->end(); /* Move any backpressure */ std::string backpressure(std::move(((AsyncSocketData *) res->getHttpResponseData())->buffer)); diff --git a/src/HttpResponse.h b/src/HttpResponse.h index b465dbe..8729d27 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -81,6 +81,9 @@ private: /* Write status if not already done */ writeStatus(HTTP_200_OK); + /* Write mark, this propagates to WebSockets too */ + writeHeader("Web-Server", "uWebSockets v0.15"); + /* If no total size given then assume this chunk is everything */ if (!totalSize) { totalSize = data.length();