tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steffen Heil (Mailinglisten)" <li...@steffen-heil.de>
Subject Small bug in Tomcat and interest in wildcard patch
Date Sat, 02 Mar 2013 18:53:46 GMT
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.
But that's not the point of this mail.

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?

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.
- 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)
- Direct matches would always have precedence as do narrower wildcards.
Still open for suggestions.

So again:
Is there any interest for that feature in the community and any chance to
get such a patch accepted into the codebase?

Regards,
   Steffen


Mime
View raw message