Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA1EED37C for ; Sat, 2 Mar 2013 20:46:34 +0000 (UTC) Received: (qmail 61160 invoked by uid 500); 2 Mar 2013 20:46:31 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 60967 invoked by uid 500); 2 Mar 2013 20:46:31 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 60958 invoked by uid 99); 2 Mar 2013 20:46:31 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Mar 2013 20:46:31 +0000 Received: from localhost (HELO [192.168.23.9]) (127.0.0.1) (smtp-auth username markt, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Mar 2013 20:46:30 +0000 Message-ID: <5132651B.4030203@apache.org> Date: Sat, 02 Mar 2013 20:46:19 +0000 From: Mark Thomas User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: users@tomcat.apache.org Subject: Re: Small bug in Tomcat and interest in wildcard patch References: <676548DEB4D5654FA7F4909FD9FE4C0D0BC91D@dc2008r2.sh-solutions.intern> In-Reply-To: <676548DEB4D5654FA7F4909FD9FE4C0D0BC91D@dc2008r2.sh-solutions.intern> X-Enigmail-Version: 1.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 02/03/2013 18:53, Steffen Heil (Mailinglisten) wrote: > Hi > > I looked into the source of tomcat 7 (7.0.x trunk) to extend it to support > wildcard aliases (such as *.example.com). > I found the class org.apache.tomcat.util.http.mapper.Mapper. > Looking at it, I found a small bug (lines 210-213): > > if (pos < 0) { > log.error("No host found: " + hostName); > } > Host mappedHost = hosts[pos]; > > This can of course raise an IndexOutOfBoundsException. Please create a Bugzilla entry for that. If you wanted to provide a patch to fix it as well, that would be great. > I have non-optimal patch that extends the feature I need but that patch is > not optimal. > Is there any interest for that feature in the community and any chance to > get such a patch accepted into the codebase? It is a long-standing enhancement request. At $work I have customers interested in this feature. If it was felt that the feature would never be included, the enhancement request would have been closed as WONTFIX. > Then I would do some cleanups and improvements and publish the patch. > > I would do with the following constraints: > - Wildcards would be automatically detected. (Just use hostnames starting > with "*.") > - As long as no wildcards are defined, there would be no performance penalty > for the patch. Good. That is probably essential to get any patch accepted. > - Wildcard processing would be as fast as possible. :) > - Wildcards would match any number of subdomains (*.example.com would match > a.b.c.d.example.com, but not example.com) OK. > - Direct matches would always have precedence as do narrower wildcards. Seems reasonable. > Still open for suggestions. I like that you have clearly defined the expected behaviour. That is a big plus. The changes would need some documentation. > So again: > Is there any interest for that feature in the community and any chance to > get such a patch accepted into the codebase? Yes and yes. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org