tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Small bug in Tomcat and interest in wildcard patch
Date Sat, 02 Mar 2013 20:46:19 GMT
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


Mime
View raw message