Skip to content

Commit b4e906c

Browse files
authored
1 parent 6a475d3 commit b4e906c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sdk/tables/data-tables/src/TableTransaction.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ export class InternalTableTransaction {
154154
const urlParts = url.split("?");
155155
this.url = urlParts[0];
156156
const sas = urlParts.length > 1 ? `?${urlParts[1]}` : "";
157-
this.url = `${this.url}/$batch${sas}`;
157+
this.url = `${this.getUrlWithSlash()}$batch${sas}`;
158158
} else {
159159
// When using a SharedKey credential no SAS token is needed
160-
this.url = `${this.url}/$batch`;
160+
this.url = `${this.getUrlWithSlash()}$batch`;
161161
}
162162
}
163163

@@ -307,6 +307,10 @@ export class InternalTableTransaction {
307307
throw new Error("All operations in a transaction must target the same partitionKey");
308308
}
309309
}
310+
311+
private getUrlWithSlash(): string {
312+
return this.url.endsWith("/") ? this.url : `${this.url}/`;
313+
}
310314
}
311315

312316
function parseTransactionResponse(transactionResponse: PipelineResponse): TableTransactionResponse {

0 commit comments

Comments
 (0)