Browse Source

Decode URL content before passing it to NestedLocation.parse

URL can contains empty spaced encoded as %20, so it should be decoded
before passing it to NestedLocation. NestedLocation expects file system
path which should not contain URL encoded values.

See gh-39675
pull/39958/head
_ext Slovak, Jiri 2 years ago committed by Phillip Webb
parent
commit
06569e76f6
  1. 3
      spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/nested/NestedUrlConnection.java

3
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/nested/NestedUrlConnection.java

@ -38,6 +38,7 @@ import java.util.List; @@ -38,6 +38,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.springframework.boot.loader.net.util.UrlDecoder;
import org.springframework.boot.loader.ref.Cleaner;
/**
@ -76,7 +77,7 @@ class NestedUrlConnection extends URLConnection { @@ -76,7 +77,7 @@ class NestedUrlConnection extends URLConnection {
private NestedLocation parseNestedLocation(URL url) throws MalformedURLException {
try {
return NestedLocation.parse(url.getPath());
return NestedLocation.parse(UrlDecoder.decode(url.getPath()));
}
catch (IllegalArgumentException ex) {
throw new MalformedURLException(ex.getMessage());

Loading…
Cancel
Save