Loading editor/src/webedit_server.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,13 @@ void webedit::Server::RequestEvent(libhttppp::HttpRequest &curreq, std::string url = curreq.getRequestURL(); std::string prefix = _config.getPrefix(); // Normalize the prefix to have no trailing slash so that stripping it // always leaves a leading slash on the remaining path. Without this a // configured prefix of "/editor/" would turn "/editor/css/editor.css" // into "css/editor.css" (no leading slash) and break path resolution. if (prefix.size() > 1 && prefix.back() == '/') prefix.pop_back(); // When mounted behind a proxy prefix (e.g. /editor) the browser must // see a trailing slash, otherwise relative asset URLs (css/editor.css, // js/i18n.js) resolve against the parent path and bypass the prefix. Loading Loading
editor/src/webedit_server.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,13 @@ void webedit::Server::RequestEvent(libhttppp::HttpRequest &curreq, std::string url = curreq.getRequestURL(); std::string prefix = _config.getPrefix(); // Normalize the prefix to have no trailing slash so that stripping it // always leaves a leading slash on the remaining path. Without this a // configured prefix of "/editor/" would turn "/editor/css/editor.css" // into "css/editor.css" (no leading slash) and break path resolution. if (prefix.size() > 1 && prefix.back() == '/') prefix.pop_back(); // When mounted behind a proxy prefix (e.g. /editor) the browser must // see a trailing slash, otherwise relative asset URLs (css/editor.css, // js/i18n.js) resolve against the parent path and bypass the prefix. Loading