Skip to content
Permalink
Browse files
If presumed URI does not decode, it's not a URI. Fixes #2264.
  • Loading branch information
headius committed Dec 2, 2014
1 parent 329bad2 commit f0aaf44835b26e66ccd42c6d3698ab1320b816df
Showing with 4 additions and 0 deletions.
  1. +4 −0 core/src/main/java/org/jruby/util/JarResource.java
@@ -24,6 +24,10 @@ public static JarResource create(String pathname) {
// since pathname is actually an uri we need to decode any url decoded characters like %20
// which happens when directory names contain spaces
sanitized = URLDecoder.decode(sanitized, "UTF-8");
} catch (IllegalArgumentException iae) {
// something in the path did not decode, so it's probably not a URI
// See jruby/jruby#2264.
return null;
} catch (UnsupportedEncodingException e) {
throw new RuntimeException( "hmm - system does not know UTF-8 string encoding :(" );
}

0 comments on commit f0aaf44

Please sign in to comment.