summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Rooney <rooneg@apache.org>2006-01-09 05:43:07 +0000
committerGarrett Rooney <rooneg@apache.org>2006-01-09 05:43:07 +0000
commita8f95ba3449a270afc7fc26615e21cb0806a5ec0 (patch)
tree1206d8651ac13daee12c9147fd78741cf908ee77
parent12c486c895b67c1ef05c1e82fe2703f46b695858 (diff)
downloadhttpd-a8f95ba3449a270afc7fc26615e21cb0806a5ec0.tar.gz
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
-rw-r--r--modules/proxy/mod_proxy_fcgi.c14
1 files changed, 9 insertions, 5 deletions
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;