You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Thanks for raising this! I've revised UrlResource.getFilename overall, taking URL.getPath() as a starting point and then applying our StringUtils.getFilename delegate, in alignment with other Resource implementations.
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:
The text was updated successfully, but these errors were encountered: