Bug 52156 - ServletContext.getResource(path) doesn't accept ".." anymore
ServletContext.getResource(path) doesn't accept ".." anymore
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.22
PC All
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
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.