From ce81be85c72123e4683f335cb5dd29e586b9f4f6 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Fri, 4 May 2018 07:48:48 +0300 Subject: [PATCH] resolves #48: custom css ineffectual behind reverse proxy Caddy (and probably other webservers) add a Content-Type header when one was not supplied by the application backend. Under Chromium, the css file is not interpreted if the webserver delivers it with Content-Type: text/plain, althugh it does work if no Content-Type header is set. To prevent the frontend proxy from adding the wrong header, set it correctly in the first place --- src/server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server.cpp b/src/server.cpp index 5dbc74f..7aa7abd 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -217,6 +217,7 @@ public: } } else if(resource.compare("/custom/style.css") == 0) { c->set_status(websocketpp::http::status_code::ok); + c->append_header("Content-Type", "text/css; charset=utf-8"); c->append_header("Content-Transfer-Encoding", "binary"); c->set_body(laminar.getCustomCss()); } else if(resources.handleRequest(resource, &start, &end, &content_type)) {