arturobernalg opened a new pull request, #1260:
URL: https://github.com/apache/tomcat/pull/1260

   Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=70360
   
   `UriUtil.warToJar()` builds the `jar:` URI with `new URI("jar", file, 
null)`. The multi-argument URI constructors always quote '%', but the path of a 
`war:file:` URL is already percent-encoded, so it is encoded twice: 
`war:file:/some%20dir/app.war*/WEB-INF/lib/a.jar` becomes 
`jar:file:/some%2520dir/app.war!/WEB-INF/lib/a.jar`.
   
   RFC 3986, section 2.4: "Implementations must not percent-encode or decode 
the same string more than once". 10.1.x and 9.0.x are not affected, they still 
use the URL constructor.
   
   The single argument constructor is now used, as `buildJarUrl()` already does.
   
   Tested on a local Tomcat with `unpackWARs="false"` and a WAR whose 
WEB-INF/lib JAR contains a web-fragment.xml, no Spring Boot involved:
   
   | appBase | before | after |
   |---|---|---|
   | `.../some dir/apps` | "Failed to scan JAR", `NoSuchFileException: 
.../some%20dir/apps/app.war`, fragment ignored | fragment applied, no warning |
   | `.../nospace/apps` | fragment applied | fragment applied |
   
   The new test in TestUriUtil fails without the change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to