Strip query string from request path for font-awesome

This commit is contained in:
Eric Harding committed 2018-05-09 20:27:08 -04:00
1 parent fefa659150
commit 0cda9ec9ae
1 file changed
+10 -1
+10 -1
View File
@@ -198,9 +198,18 @@ namespace http {
con->set_status(websocketpp::http::status_code::ok);
}
std::string strip_query_str(const std::string& request) {
auto position = request.find("?");
if (position != std::string::npos) {
return request.substr(0, position);
}
return request;
}
void on_http(connection_hdl hdl) {
auto con = _server.get_con_from_hdl(hdl);
auto resource = con->get_resource();
auto resource = strip_query_str(con->get_resource());
LOG(Api,Info, "REQUEST: {}", resource);
if (boost::iequals(resource, "/config/.all")) {
return_dotall(con);
}