Greg,
Just a quick comment here.
I don't know how you've implemented this, but here's my opinion:
If you're accepting "//" as "/", then you should do this always. An approach of first trying file system access directly, then trying with the stuff hacked is a recipe for (a possible security-) disaster, IMO - that is when you get problems such as you outline: Something working one way on one OS, but another way (with a possible huge security hole) on another OS.
Also, what about "///"? Or "////" for that matter?
I think you should do this quick and brutal BEFORE accessing any files and whatnots, possibly even before giving any Servlet access to the URL line (req.getPathInfo()), so that some user-implemented default servlet doesn't suddenly just shove the pathInfo to the filesystem. Do a quick scan over the url string, very early: More than one consecutive slash is collapsed to one, regardless of how many. Then the processing proceeds.
PS: Come to think about it - wasn't such a double-slash handling once a big issue with some MS bug thingy? I don't remember it clearly, but I think it had something to do with normalization and encoding combined with some double slashes stuff..! And then I think we had a couple of versions of some MS OS where "..." (three dots) was two directories up, a "convenient shorthand" for "../..", which of course also opens up a whole raft of interesting security issues. Possibly check against that too, or?
According to RFC2396:
path_segments = segment *( "/" segment )
so // is significant in a URI
So your URI has three segments:
"test"
""
"favicon.ico"
Now it turns out that the implementation of FileURL Handler interprests
"" segments as ".". But I can't see anywhere that is mandated.
Jetty has a very strict policy on file aliases, because they can be used to pass security constraints.
Eg. on VMS you can try hit /snoop.jsp;4 and the ;4 passes anything mapped to *.jsp. But for a VMS file
system ;4 is a version number, so you will get the source code of the JSP!
Thus by default, Jetty does not accept any file requests for aliases files - because who knows what strange
file system it will be run on.
Is it possible to get this test changed.... it looks to be a bug in the test to me.