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 3AC0C107AC for ; Tue, 4 Mar 2014 08:58:54 +0000 (UTC) Received: (qmail 69174 invoked by uid 500); 4 Mar 2014 08:58:51 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 68662 invoked by uid 500); 4 Mar 2014 08:58:45 -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 68654 invoked by uid 99); 4 Mar 2014 08:58:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2014 08:58:44 +0000 X-ASF-Spam-Status: No, hits=0.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [212.82.96.147] (HELO nm9-vm4.bullet.mail.ir2.yahoo.com) (212.82.96.147) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2014 08:58:38 +0000 Received: from [212.82.98.62] by nm9.bullet.mail.ir2.yahoo.com with NNFMP; 04 Mar 2014 08:58:17 -0000 Received: from [46.228.39.103] by tm15.bullet.mail.ir2.yahoo.com with NNFMP; 04 Mar 2014 08:58:17 -0000 Received: from [127.0.0.1] by smtp140.mail.ir2.yahoo.com with NNFMP; 04 Mar 2014 08:58:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1393923496; bh=3eWxURdN8gsVqezj5T7JHVljpi68QXVDXAyhUSQjYxo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:References:Mime-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Cc:X-Mailer:From:Subject:Date:To; b=37oDHXbejAc0/BHciZtuTrXtkwKuey1h5KuiZ2Z00eVcbU2oH2ydur0w1fmI5cNttR/SqGjXCNnbbGcVeu1QEVRbXiwZdaGEVZ6Y5hmvd8RsDgj777bdsVM6dcR6eGAsbUc/R3vBbTWw+rOkdJri4vBQ3kMc9z/A/14CK6J25WQ= X-Yahoo-Newman-Id: 996647.96722.bm@smtp140.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: LR_r794VM1nHlRfTJrlAZ8ZPiNb23SqihYOUrs9gTjkPQ6. ipqKhj3h.ZsVWYR2_nBFpjpLbgad4KSGaI5zS9tsqDCWxdkQu973ADgQRWPn Xz0LPICkat1CGJ6IGA1OAzSJMTHXmHtx0GzUdCNzR8cj2e4dsC2Mk_N_s5QB t8DjCzQeB9lbBjf3KJSFTnrD4BGDNx80QEYsFDUxzSfsh.EK8POgIFWf2rSz P70Gc_7_zyAdWnlF7ulYpS0.qqsGOYBA.AIb71MWvucoq1rc4fGuz3kBoPTt 2ttErl_DvDetociMjv6Pdg1wwWeqK6Ieo9mEcqk9cbVWNTk_N.uA5JheKDm4 g0Bv2hDrqY7KBtuF3S2OQqFjFQrJA8Ozx1gSiYB4yG50ifFMH45MdyWfXQuY srcUiJjI_Vm6IiIvvMCG5r6Z_ctGYnNx_WE_EAWm3okrt9eMtuvMr_3HQ8E0 y0SvWeb8fYKiFrEi4o5dECzU4yUig8RKiEDs0D9X5dRWnUfWa40vpE7wpch2 w4Qj.dGa76Rpi28takQlnP_4q3_DztLurIRz_oaw1XL7zMMLRESeMNwFwxcd XFIH7857qSaZPMiSyZQ-- X-Yahoo-SMTP: hH0MxASswBBqvc5Aib4u9F0SkAM- X-Rocket-Received: from [192.168.0.4] (s7g2vp2@90.210.81.139 with xymcookie [46.228.39.225]) by smtp140.mail.ir2.yahoo.com with SMTP; 04 Mar 2014 08:58:16 +0000 UTC References: <1393617163.75723.YahooMailNeo@web172804.mail.ir2.yahoo.com> <9DE4A33D-1E30-47D8-A966-E1BAC139925B@jellybaby.net> <7A1BD74D-CC6A-4128-A9B4-6EB8A31CBB88@jellybaby.net> Mime-Version: 1.0 (1.0) In-Reply-To: <7A1BD74D-CC6A-4128-A9B4-6EB8A31CBB88@jellybaby.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-Id: <5650D2C9-3C7B-40F5-B229-2EAC4AB7082F@yahoo.co.uk> Cc: "dev@httpd.apache.org" X-Mailer: iPhone Mail (11B651) From: Kevin Gale Subject: Re: Improving The RewriteMap Program Feature Date: Tue, 4 Mar 2014 08:58:16 +0000 To: "dev@httpd.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org Hi Tim What are the chances of getting this into the next release of Apache? Kev > On 2 Mar 2014, at 17:03, Tim Bannister wrote: >=20 >> On 2 Mar 2014, at 16:46, Tim Bannister wrote: >>=20 >> On 1 Mar 2014, at 12:20, Eric Covener wrote: >>=20 >>>> If the RewriteMap Program fails, the code within mod_rewrite returns an= >>>> empty string rather than NULL. In my tests this caused /index.htm to be= >>>> returned as the URL which is not very useful. I think it makes more sen= se to >>>> handle this situation as a NULL so that the default key is used as we c= ould >>>> then provide a backup method. >>>> eg: >>>> RewriteRule ^/proxy/(.*) ${proxymap:$1|/proxybackup/$1} [P] >>>> RewriteRule ^/proxybackup/(.*) /proxybackup.php?url=3D$1 [L] >>>>=20 >>>> Looking at the mod_rewrite source code this appears to be a one liner c= hange >>>> in lookup_map_program: >>>> if (i =3D=3D 4 && !strcasecmp(buf, "NULL")) >>>> ..... >>>> becomes: >>>> if ((i =3D=3D 0) || (i =3D=3D 4 && !strcasecmp(buf, "NULL"))) { >>>> ..... >>>>=20 >>>> Is this minor change something that you would consider implementing? >>>=20 >>> I think it would need to be opt-in in 2.4, as changing it could break >>> configs depending on the current behavior. Maybe some extra flag on >>> the definition of the RewriteMap or a RewriteOption? >>=20 >> Here's how I'd want it: >>=20 >> RewriteMap foo prgfb:/www/bin/example.pl >>=20 >> (prgfb =E2=80=94 program with fallback). >=20 > In other words, a user could choose =E2=80=9Cprg=E2=80=9D or =E2=80=9Cprgf= b=E2=80=9D. prg selects the legacy, httpd-2.0 behaviour. prgfb selects a new= behaviour which handles map program failure as NULL. >=20 > Eventually (2.6?), httpd could merge =E2=80=9Cprg=E2=80=9D and =E2=80=9Cpr= gfb=E2=80=9D into a single map type. >=20 >=20 > --=20 > Tim Bannister =E2=80=93 isoma@jellybaby.net >=20