You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ia...@apache.org on 2001/06/27 00:32:51 UTC
cvs commit: httpd-proxy/module-2.0 mod_proxy.c
ianh 01/06/26 15:32:50
Modified: module-2.0 mod_proxy.c
Log:
ProxyPass & ProxyPass Reverse now can be specified in <Location> directives
Revision Changes Path
1.47 +33 -10 httpd-proxy/module-2.0/mod_proxy.c
Index: mod_proxy.c
===================================================================
RCS file: /home/cvs/httpd-proxy/module-2.0/mod_proxy.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- mod_proxy.c 2001/05/23 03:39:39 1.46
+++ mod_proxy.c 2001/06/26 22:32:49 1.47
@@ -496,11 +496,22 @@
proxy_server_conf *conf =
(proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module);
struct proxy_alias *new;
-
- new = apr_array_push(conf->aliases);
- new->fake = f;
- new->real = r;
- return NULL;
+ if (r!=NULL && cmd->path == NULL ) {
+ new = apr_array_push(conf->aliases);
+ new->fake = f;
+ new->real = r;
+ } else if (r==NULL && cmd->path != NULL) {
+ new = apr_array_push(conf->aliases);
+ new->fake = cmd->path;
+ new->real = f;
+ } else {
+ if ( r== NULL)
+ return "ProxyPass needs a path when not defined in a location";
+ else
+ return "ProxyPass can not have a path when defined in a location";
+ }
+
+ return NULL;
}
static const char *
@@ -512,9 +523,21 @@
conf = (proxy_server_conf *)ap_get_module_config(s->module_config,
&proxy_module);
- new = apr_array_push(conf->raliases);
- new->fake = f;
- new->real = r;
+ if (r!=NULL && cmd->path == NULL ) {
+ new = apr_array_push(conf->raliases);
+ new->fake = f;
+ new->real = r;
+ } else if (r==NULL && cmd->path != NULL) {
+ new = apr_array_push(conf->raliases);
+ new->fake = cmd->path;
+ new->real = f;
+ } else {
+ if ( r == NULL)
+ return "ProxyPassReverse needs a path when not defined in a location";
+ else
+ return "ProxyPassReverse can not have a path when defined in a location";
+ }
+
return NULL;
}
@@ -709,9 +732,9 @@
"on if the true proxy requests should be accepted"),
AP_INIT_TAKE2("ProxyRemote", add_proxy, NULL, RSRC_CONF,
"a scheme, partial URL or '*' and a proxy server"),
- AP_INIT_TAKE2("ProxyPass", add_pass, NULL, RSRC_CONF,
+ AP_INIT_TAKE12("ProxyPass", add_pass, NULL, RSRC_CONF|ACCESS_CONF,
"a virtual path and a URL"),
- AP_INIT_TAKE2("ProxyPassReverse", add_pass_reverse, NULL, RSRC_CONF,
+ AP_INIT_TAKE12("ProxyPassReverse", add_pass_reverse, NULL, RSRC_CONF|ACCESS_CONF,
"a virtual path and a URL for reverse proxy behaviour"),
AP_INIT_ITERATE("ProxyBlock", set_proxy_exclude, NULL, RSRC_CONF,
"A list of names, hosts or domains to which the proxy will not connect"),