https://issues.apache.org/bugzilla/show_bug.cgi?id=57215

            Bug ID: 57215
           Summary: Regression in Tomcat 7.0.54 after Bug 56501 with urls
                    starting with //
           Product: Tomcat 7
           Version: 7.0.54
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: dco...@uk.ibm.com

After upgrading from 7.0.52 of Tomcat to 7.0.54 we found that our application
was now returning 404 resource not found errors when the request uri starts
with //.
eg. We have an embedded server created and started something like:

 org.apache.catalina.startup.Embedded embedded = new Embedded();
 org.apache.catalina.Engine engine engine = embedded.createEngine();
 engine.setName("");
 embedded.setContainer(engine);
 embedded.addEngine(engine);

 ...

 String startPathContextRoot = "c:\website\data\startPath";
 org.apache.catalina.Context startPathContext =
embedded.createContext("/startPath",startPathContextRoot);

 embedded.start()

Then a request to http://host:port//startPath returns 404.
Whereas at Tomcat 7.0.52 it returns what we would expect from a request to 
http://host:port/startPath.
The same behaviour is seen with requests to extended URLs eg:
  http://host:port//startPath/anotherPath.
where they end up at the servlet as expected with 7.0.53 and not with 7.0.54

Debugging this a bit I found that the problem was introduced at 7.0.53 and by
the changes under 
https://issues.apache.org/bugzilla/show_bug.cgi?id=56501
which for Tomcat 7 were revision 
http://svn.apache.org/viewvc?view=revision&revision=1594028
If I run our app without these changes in at 7.0.54 then it works fine.

Looking at the changes in the revision I saw some tests were added and so I
tried adding some new tests to
tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java which I think
example the problem:

    @Test
    public void testBug56501p() throws Exception {
        doBug56501("/path", "//path", "/path");
    }

    @Test
    public void testBug56501q() throws Exception {
        doBug56501("/path", "//path/", "/path");
    }

    @Test
    public void testBug56501r() throws Exception {
        doBug56501("/path", "//path/bob", "/path");
    }

    @Test
    public void testBug56501s() throws Exception {
        doBug56501("/path", "//path/bob/", "/path");

If I run these at 7.0.53 they pass.
and running at 7.0.54 they fail with:

Testcase: testBug56501p took 0.307 sec
    FAILED
expected:</[path]> but was:</[]>

Testcase: testBug56501q took 0.275 sec
    FAILED
expected:</[path]> but was:</[]>

Testcase: testBug56501r took 0.246 sec
    FAILED
expected:</[path]> but was:</[]>

Testcase: testBug56501s took 0.32 sec
    FAILED
expected:</[path]> but was:</[]>


I can try and create this with a simple servlet/setup if required if the test
additions are not enough.

David

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to