Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 16733 invoked from network); 24 Feb 2011 12:55:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2011 12:55:58 -0000 Received: (qmail 48886 invoked by uid 500); 24 Feb 2011 12:55:58 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 48371 invoked by uid 500); 24 Feb 2011 12:55:54 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 48363 invoked by uid 99); 24 Feb 2011 12:55:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 12:55:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of burgoyne@keenuh.com designates 66.147.249.253 as permitted sender) Received: from [66.147.249.253] (HELO oproxy1-pub.bluehost.com) (66.147.249.253) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 24 Feb 2011 12:55:48 +0000 Received: (qmail 29930 invoked by uid 0); 24 Feb 2011 12:55:27 -0000 Received: from unknown (HELO box548.bluehost.com) (74.220.219.148) by oproxy1.bluehost.com.bluehost.com with SMTP; 24 Feb 2011 12:55:27 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=keenuh.com; h=Message-ID:In-Reply-To:References:Date:Subject:From:To:Reply-To:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Priority:Importance:X-Identified-User; b=LRIYyvuLim4oaE0KOHORH/QXEK37MrsygYiJW17pmkGQlJrpFTF/1Mnvsd+zdJ4oPEWJnCMdV0gp2roEdVSCwdntdITbguPOkzkwPbLEdgkaBtqD6Iie596c5mM073+s; Received: from localhost ([127.0.0.1] helo=box201.bluehost.com) by box548.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1Psaj8-0001RV-RR for dev@httpd.apache.org; Thu, 24 Feb 2011 05:55:27 -0700 Received: from 192.197.178.2 ([192.197.178.2]) (proxying for 142.53.63.186) (SquirrelMail authenticated user burgoyne@keenuh.com) by box201.bluehost.com with HTTP; Thu, 24 Feb 2011 07:55:26 -0500 Message-ID: In-Reply-To: References: <20110223195643.2ef83572@baldur> Date: Thu, 24 Feb 2011 07:55:26 -0500 Subject: Re: ProxyPreserveHost - added functionality From: "Jeffrey E Burgoyne" To: dev@httpd.apache.org Reply-To: burgoyne@keenuh.com User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Identified-User: {2835:box548.bluehost.com:keenuhco:keenuh.com} {sentby:program running on server} Against 2.2.14 source, in short, add an array of URL's for which the preserveproxyhost is required, bit of code for the config parameter, and a small change to check if the URL matches one of the list. ht01b07:~/apacheConfig/tarball/httpd-2.2.14/modules/proxy # diff mod_proxy.h mod_proxy.h.real 177,180d176 < < /* Array of URL's for which the hostname needs to be preserved when proxied */ < < apr_array_header_t *preserve_host_urls; ht01b07:~/apacheConfig/tarball/httpd-2.2.14/modules/proxy # ht01b07:~/apacheConfig/tarball/httpd-2.2.14/modules/proxy # diff mod_proxy.c mod_proxy.c.real 1071d1070 < ps->preserve_host_urls = apr_array_make(p, 10, sizeof(char*)); 1114d1112 < ps->preserve_host_urls = apr_array_append(p, base->preserve_host_urls, overrides->preserve_host_urls); 1615,1629d1612 < set_preserve_host_url(cmd_parms *parms, void *dummy, const char *arg) < { < proxy_server_conf *psf = < ap_get_module_config(parms->server->module_config, &proxy_module); < < apr_array_header_t *preserve_host_urls = < psf->preserve_host_urls; < < *(const char**)apr_array_push(preserve_host_urls) = < apr_pstrdup(parms->pool, arg); < < return NULL; < } < < static const char * 2119,2120d2101 < AP_INIT_TAKE1("ProxyPreserveHostURL", set_preserve_host_url, NULL, RSRC_CONF, < "Set a base URL where the host name needs to be preserved when proxying"), ht01b07:~/apacheConfig/tarball/httpd-2.2.14/modules/proxy # ht01b07:~/apacheConfig/tarball/httpd-2.2.14/modules/proxy # diff mod_proxy_http.c mod_proxy_http.c.real 677,696d676 < < < static < int ap_not_in_preserve_list(char *url, < apr_array_header_t *preserve_host_urls, apr_pool_t *memoryPool) < { < int i; < int l; < < for (i = 0; i < preserve_host_urls->nelts; i++) { < const char *s = ((const char**)preserve_host_urls->elts)[i]; < l = strlen(s); < < if (!strncmp(url, s, l)) { < return 0; < } < } < return 1; < } < 753,754c733 < if (conf->preserve_host == 0 && < ap_not_in_preserve_list(url, conf->preserve_host_urls, r->pool)) { --- > if (conf->preserve_host == 0) { ht01b07:~/apacheConfig/tarball/httpd-2.2.14/modules/proxy # > Quite small, only took a few hours to do. I'll post it tomorrow. > > Basically it does the same as PreserveProxyHost except it works on a URL > basis, not on a per virtual host basis. > > >> On Wed, 23 Feb 2011 14:12:44 -0500 >> "Jeffrey E Burgoyne" wrote: >> >> >>> If people feel this is a worthwhile addition to the main code base, >>> please >>> let me know and I'll pass it back. >> >> Not sure I follow exactly what you've added. >> >> How big a patch is your change? If it's not too big to admit >> easy review, you could post it or a URL to look at it. >> >> >> -- >> Nick Kew >> >> Available for work, contract or permanent. >> http://www.webthing.com/~nick/cv.html >> > > > -- > Jeffrey Burgoyne > Chief Technology Officer > KCSI Keenuh Consulting Services Inc > www.keenuh.com > burgoyne@keenuh.com > > > -- Jeffrey Burgoyne Chief Technology Officer KCSI Keenuh Consulting Services Inc www.keenuh.com burgoyne@keenuh.com