Commit 21e1020e authored by jan.koester's avatar jan.koester
Browse files

test

parent f2da72ed
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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.