mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
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
This commit is contained in:
parent
083f136186
commit
ce81be85c7
@ -217,6 +217,7 @@ public:
|
|||||||
}
|
}
|
||||||
} else if(resource.compare("/custom/style.css") == 0) {
|
} else if(resource.compare("/custom/style.css") == 0) {
|
||||||
c->set_status(websocketpp::http::status_code::ok);
|
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->append_header("Content-Transfer-Encoding", "binary");
|
||||||
c->set_body(laminar.getCustomCss());
|
c->set_body(laminar.getCustomCss());
|
||||||
} else if(resources.handleRequest(resource, &start, &end, &content_type)) {
|
} else if(resources.handleRequest(resource, &start, &end, &content_type)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user