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
pull/53/head
Oliver Giles 6 years ago
parent 083f136186
commit ce81be85c7

@ -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)) {

Loading…
Cancel
Save