Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 490E610444 for ; Thu, 11 Jul 2013 15:20:00 +0000 (UTC) Received: (qmail 12377 invoked by uid 500); 11 Jul 2013 15:19:58 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 12276 invoked by uid 500); 11 Jul 2013 15:19:57 -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 12259 invoked by uid 99); 11 Jul 2013 15:19:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jul 2013 15:19:56 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [64.59.134.12] (HELO smtp-out-04.shaw.ca) (64.59.134.12) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jul 2013 15:19:49 +0000 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=6HkG4LK5i0ZTEQwzSfMqnsQ8WbrxJ2NwB1mI+RNtyjI= c=1 sm=1 a=kiG6hdqEmeoA:10 a=2pqqzDx6IZcA:10 a=BLceEmwcHowA:10 a=8nJEP1OIZ-IA:10 a=i4Fdut7b+dhLwo1kSfGdPw==:17 a=zrEz_Mqj8iMm52ISrk0A:9 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO [192.168.0.107]) ([96.54.212.233]) by smtp-out-04.shaw.ca with ESMTP; 11 Jul 2013 09:19:06 -0600 Message-ID: <51DECDE0.1070604@pearsoncmg.com> Date: Thu, 11 Jul 2013 08:23:12 -0700 From: Chris Darroch Organization: Pearson CMG/PLT User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.24) Gecko/20100319 SeaMonkey/1.1.19 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: UseListenScheme proposal References: <51DE1482.6060503@pearsoncmg.com> <8201F7B6-F44D-443E-BC2E-A17273518D9F@webthing.com> In-Reply-To: <8201F7B6-F44D-443E-BC2E-A17273518D9F@webthing.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Nick: >> The idea is to introduce a non-default "UseListenScheme On" setting >> which uses the scheme from the Listen directive when constructing >> self-referencing URLs: > > Can you clarify for the lazy among us how this might interact with > existing configuration options for self-referencing URLs? I'm thinking > mainly "UseCanonicalName" and "Header Edit", though there's also > the ProxyPass* family, hairy Rewrite hacks, and other bits&pieces. > > (a) What does your patch enable over and above what we have? It's pretty basic -- the current logic in ap_construct_url() when determining the scheme is from http_scheme() in modules/http, namely, use the scheme from ServerName, if any, otherwise "http". This patch adds a preceding check: first look for a scheme in the corresponding Listen directive, then for a scheme in ServerName, and finally fall back to "http". The ap_construct_url() code is used, so far as I know, in just a handful of key places where self-referencing URLs are created for Location headers: handling Redirects and ProxyPassReverse header munging, adding trailing / chars in mod_dir, generating Location headers in mod_dav, and a couple of other spots. The UseListenScheme directive plays alongside the other two directives UseCanonicalName and UseCanonicalPhysicalPort in telling ap_construct_url() what to do. I didn't see a clean way to add to their configuration options something involving the scheme; it seemed cleaner to add a separate directive so we have one each to specify how scheme, name, and port are determined in ap_construct_url(). > (b) How much duplication of functionality does it introduce? None, so far as I can tell ... > (c) Is there a potential opportunity to deprecate some of our uglier > historic hacks and clean up duplication? I didn't see a way to do this and retain backwards-compatibility for configuration files around ServerName, etc. And I was really looking for something which would leverage the existing configs in an example like the one I supplied, where Listen "should" be telling the server that traffic on a specific port needs the https:// scheme. And to be honest, I need to backport this to 2.2.x for our internal purposes, so I wasn't looking for a big trunk/2.6/3.0 config cleanup opportunity (and I do not want to open that can of worms here! :-) I'm sure 3.0 could benefit from collapsing the Use* directives down, and possibly reworking how ServerName, ServerAlias, Listen, etc. all play together. For another day ... Chris. -- GPG Key ID: 088335A9 GPG Key Fingerprint: 86CD 3297 7493 75BC F820 6715 F54F E648 0883 35A9