Description
Jerome Hordies opened SPR-15411 and commented
UrlResource.getFilename uses URL.getFile() instead of URL.getPath()
The URL.getFile() javadocs say :
Gets the file name of this URL. The returned file portion will be the same as getPath(), plus the concatenation of the value of getQuery(), if any. If there is no query portion, this method and getPath() will return identical results.
This causes a bug in Spring boot when specifying --spring.config.location=http://host/group/repo/raw/branch/config.yml?private_token=NyAq4wDit3hmJ7UZPyMU because ".yml?private_token=NyAq4wDit3hmJ7UZPyMU" is not a supported extension.
My workaround until this gets fixed is to use --spring.config.location=http://host/group/repo/raw/branch/config.yml?private_token=NyAq4wDit3hmJ7UZPyMU&fake_param=whatever.yml
Affects: 3.2.18, 4.2.9, 4.3.7, 5.0 M5
Reference URL: #1372
Issue Links:
- UnknownHostException not accepted as "resource not found" anymore [SPR-15433] #19994 UnknownHostException not accepted as "resource not found" anymore
- Be more defensive in UrlResource about cleaning the path [SPR-17198] #21732 Be more defensive in UrlResource about cleaning the path