Skip to content

Commit

Permalink
fix: 'URL bucket doesn't match' error appears if to create an unpubli…
Browse files Browse the repository at this point in the history
…sh request for some conversations #463 (#467)
  • Loading branch information
astsiapanay authored Sep 5, 2024
1 parent 395c31c commit 08e4699
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ private void collectLinksForReplacement(List<ResourceDescription> publicConversa
if (type == ResourceType.CONVERSATION) {
publicConversations.add(to);
} else if (type == ResourceType.FILE) {
attachmentsMap.put(from.getUrl(), to.getUrl());
String decodedUrl = UrlUtil.decodePath(from.getUrl());
attachmentsMap.put(decodedUrl, to.getUrl());
} else if (type == ResourceType.APPLICATION) {
publicApplications.add(to);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.epam.aidial.core.storage.BlobStorageUtil;
import com.epam.aidial.core.storage.ResourceDescription;
import com.epam.aidial.core.util.ProxyUtil;
import com.epam.aidial.core.util.UrlUtil;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import lombok.experimental.UtilityClass;
Expand Down Expand Up @@ -85,7 +86,8 @@ private void replaceAttachments(JsonArray messages, Map<String, String> attachme
isMetadata = true;
url = url.substring(ProxyUtil.METADATA_PREFIX.length());
}
String toReplace = attachmentsMapping.get(url);
String decodedUrl = UrlUtil.decodePath(url);
String toReplace = attachmentsMapping.get(decodedUrl);
if (toReplace != null) {
attachment.put("url", isMetadata ? ProxyUtil.METADATA_PREFIX + toReplace : toReplace);
}
Expand Down

0 comments on commit 08e4699

Please sign in to comment.