From: Garrett Rooney Date: Mon, 9 Jan 2006 05:43:07 +0000 (+0000) Subject: After more comparison with existing mod_proxy backends, such as http X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8f95ba3449a270afc7fc26615e21cb0806a5ec0;p=apache After more comparison with existing mod_proxy backends, such as http it seems clear that we're going to need to be able to specify arbitrary portions of the URL that need to be added to the path info. Follow the lead of mod_proxy_http and add the calculation of this into the canon handler. * modules/proxy/mod_proxy_fcgi.c (proxy_fcgi_canon): Add the path portion of the back end URL to the path_info of the request, via the ap_proxy_canonenc function. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/fcgi-proxy-dev@367208 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 8a6aac3f5a..5fed5edd9b 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -28,8 +28,7 @@ module AP_MODULE_DECLARE_DATA proxy_fcgi_module; static int proxy_fcgi_canon(request_rec *r, char *url) { char *host, sport[7]; - const char *err; - const char* scheme; + const char *err, *scheme, *path; apr_port_t port = 8000; if (strncasecmp(url, "fcgi-", 5) == 0) { @@ -61,11 +60,16 @@ static int proxy_fcgi_canon(request_rec *r, char *url) /* if literal IPv6 address */ host = apr_pstrcat(r->pool, "[", host, "]", NULL); } - + + path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0, + r->proxyreq); + if (path == NULL) + return HTTP_BAD_REQUEST; + r->filename = apr_pstrcat(r->pool, "proxy:", scheme, host, sport, "/", - NULL); + path, NULL); - r->path_info = apr_pstrdup(r->pool, url); + r->path_info = apr_pstrcat(r->pool, "/", path, NULL); } else if (strncmp(url, "local://", 8) == 0) { url += 6;