Skip to content

Commit 1e618ad

Browse files
sjuarezgxSabrina Juarez Garcia
andauthored
Avoid full URL decoding to preserve legacy GXI behavior (#1080)
* Fix URL decoding for Azure Blobs * fix typo --------- Co-authored-by: Sabrina Juarez Garcia <sabrina.juarez@globant.com>
1 parent 99101ee commit 1e618ad

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

java/src/main/java/com/genexus/GXDbFile.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,16 @@ private static String safeDecodeUrl(String uri) {
247247
String rawPath = u.getRawPath();
248248
if (rawPath == null)
249249
return uri;
250+
//Defensive code: Azure Blob URL scapes subdirectory slashes
251+
//https://github.com/Azure/azure-sdk-for-java/issues/21610
252+
String fixedPath = rawPath
253+
.replace("%2F", "/")
254+
.replace("%2f", "/");
250255

251-
boolean hasEncodedSegments = rawPath.matches(".*%[0-9A-Fa-f]{2}.*");
252-
if (!hasEncodedSegments) {
253-
return uri;
254-
}
255-
String decodedPath = URLDecoder.decode(rawPath, StandardCharsets.UTF_8.name());
256256
return new URI(
257257
u.getScheme(),
258258
u.getAuthority(),
259-
decodedPath,
259+
fixedPath,
260260
u.getRawQuery(),
261261
u.getRawFragment()
262262
).toString();

0 commit comments

Comments
 (0)