Skip to content

Commit 06569e7

Browse files
_ext Slovak, Jiriphilwebb
_ext Slovak, Jiri
authored andcommitted
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
1 parent 428ddb7 commit 06569e7

File tree

1 file changed

+2
-1
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/nested

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.Map;
3939
import java.util.Map.Entry;
4040

41+
import org.springframework.boot.loader.net.util.UrlDecoder;
4142
import org.springframework.boot.loader.ref.Cleaner;
4243

4344
/**
@@ -76,7 +77,7 @@ class NestedUrlConnection extends URLConnection {
7677

7778
private NestedLocation parseNestedLocation(URL url) throws MalformedURLException {
7879
try {
79-
return NestedLocation.parse(url.getPath());
80+
return NestedLocation.parse(UrlDecoder.decode(url.getPath()));
8081
}
8182
catch (IllegalArgumentException ex) {
8283
throw new MalformedURLException(ex.getMessage());

0 commit comments

Comments
 (0)