Bug 52156 - ServletContext.getResource(path) doesn't accept ".." anymore
Summary: ServletContext.getResource(path) doesn't accept ".." anymore
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.22
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-08 18:59 UTC by Arnaud
Modified: 2011-11-08 23:31 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arnaud 2011-11-08 18:59:53 UTC
With WAR-packaged webapp,
   getServletContext().getResource("/mydata/../mydata/myfile.txt")
should return the same URL as
   getServletContext().getResource("/mydata/myfile.txt")
but returns NULL instead.

It's ok for folder-based webapp.
It was working in Tomcat 6.0.20.
It looks like Bug 10629 (WARDirContext.java regression?).
Comment 1 Mark Thomas 2011-11-08 23:31:43 UTC
Thanks for the report. This has been fixed in trunk and 7.0.x and will be included in 7.0.23 onwards.