Skip to content

Commit 7db740c

Browse files
committed
fix bug: urldecode difference between python & java:
`~` translate to `%E7` in java, but doesn't translate in python
1 parent f657ffd commit 7db740c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fate-serving-server/src/main/java/com/webank/ai/fate/serving/model/FateFlowModelLoader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ public String getResource(Context context,ModelLoaderParam modelLoaderParam) {
148148
String modelVersion = modelLoaderParam.tableName;
149149
String modelId = modelLoaderParam.nameSpace.replace("#", "~");
150150
String uri = "/" + modelId + "/" + modelVersion;
151-
String encodeUri = URLEncoder.encode(uri,"UTF-8");
152151
for (String child : children) {
153-
if(child.endsWith(encodeUri)){
154-
urls.add(URL.valueOf(URLDecoder.decode(child,"UTF-8")));
152+
String decodeChild = URLDecoder.decode(child,"UTF-8");
153+
if (decodeChild.endsWith(uri)){
154+
urls.add(URL.valueOf(decodeChild));
155155
break;
156156
}
157157
}

0 commit comments

Comments
 (0)