Skip to content

Commit 8a53732

Browse files
committed
exporthistory: strip all trailing slashes from blob prefix
1 parent 547a1b2 commit 8a53732

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

exporthistory/src/main/java/com/microsoft/durabletask/exporthistory/activities/ExportInstanceHistoryActivity.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,14 @@ public Object run(TaskActivityContext ctx) {
8787

8888
// Generate blob name
8989
String blobFileName = generateBlobFileName(completedTimestamp, instanceId, input.getFormat().getKind());
90-
String blobPath = input.getDestination().getPrefix() != null
91-
? input.getDestination().getPrefix().replaceAll("/$", "") + "/" + blobFileName
90+
String prefix = input.getDestination().getPrefix();
91+
if (prefix != null) {
92+
while (prefix.endsWith("/")) {
93+
prefix = prefix.substring(0, prefix.length() - 1);
94+
}
95+
}
96+
String blobPath = prefix != null
97+
? prefix + "/" + blobFileName
9298
: blobFileName;
9399

94100
// Serialize

0 commit comments

Comments
 (0)