Loading src/http/HttpProxyServer.cpp +10 −2 Changes for src/http/HttpProxyServer.cpp: 10 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -204,10 +204,18 @@ void HttpProxyController::RequestEvent(libhttppp::HttpRequest &curreq, const int upstreamBase = matched.upstream; } // The route matches on pathPrefix (e.g. "/bolli"), but the backend is mounted // at "/" and knows nothing about that prefix -- forward the remainder only. std::string forwardPath = url.substr(matched.pathPrefix.size()); if (forwardPath.empty() || forwardPath[0] != '/') forwardPath = "/" + forwardPath; bool upstreamOk = false; try { libhttppp::HttpUrl upstream(upstreamBase + url); libhttppp::HttpClient client(upstream); libhttppp::HttpUrl upstream(upstreamBase + forwardPath); // vers=3: try HTTP/3 first, falling back to HTTP/2 then HTTP/1.1 over // TLS (or straight to H1 for a cleartext upstream) -- see HttpClient // ctor in libhttppp/src/http.cpp for the fallback ladder. libhttppp::HttpClient client(upstream, /*vers=*/3); libhttppp::HttpRequest outreq; outreq.setRequestType(GETREQUEST); outreq.setRequestURL(upstream.getPath()); Loading Loading
src/http/HttpProxyServer.cpp +10 −2 Changes for src/http/HttpProxyServer.cpp: 10 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -204,10 +204,18 @@ void HttpProxyController::RequestEvent(libhttppp::HttpRequest &curreq, const int upstreamBase = matched.upstream; } // The route matches on pathPrefix (e.g. "/bolli"), but the backend is mounted // at "/" and knows nothing about that prefix -- forward the remainder only. std::string forwardPath = url.substr(matched.pathPrefix.size()); if (forwardPath.empty() || forwardPath[0] != '/') forwardPath = "/" + forwardPath; bool upstreamOk = false; try { libhttppp::HttpUrl upstream(upstreamBase + url); libhttppp::HttpClient client(upstream); libhttppp::HttpUrl upstream(upstreamBase + forwardPath); // vers=3: try HTTP/3 first, falling back to HTTP/2 then HTTP/1.1 over // TLS (or straight to H1 for a cleartext upstream) -- see HttpClient // ctor in libhttppp/src/http.cpp for the fallback ladder. libhttppp::HttpClient client(upstream, /*vers=*/3); libhttppp::HttpRequest outreq; outreq.setRequestType(GETREQUEST); outreq.setRequestURL(upstream.getPath()); Loading