Removing trailing ; from resource token which is incompatible with v2 tokens (#1962)
* Removing trailing ; from resource token which is incompatible with v2 tokens * Adding check in case resourceToken is undefined * Fixing unit tests
This commit is contained in:
parent
50c47a82d6
commit
d75553a94d
|
@ -11,7 +11,7 @@ describe("parseResourceTokenConnectionString", () => {
|
|||
collectionId: "fakeCollectionId",
|
||||
databaseId: "fakeDatabaseId",
|
||||
partitionKey: undefined,
|
||||
resourceToken: "type=resource&ver=1&sig=2dIP+CdIfT1ScwHWdv5GGw==;fakeToken;",
|
||||
resourceToken: "type=resource&ver=1&sig=2dIP+CdIfT1ScwHWdv5GGw==;fakeToken",
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -25,7 +25,7 @@ describe("parseResourceTokenConnectionString", () => {
|
|||
collectionId: "fakeCollectionId",
|
||||
databaseId: "fakeDatabaseId",
|
||||
partitionKey: "fakePartitionKey",
|
||||
resourceToken: "type=resource&ver=1&sig=2dIP+CdIfT1ScwHWdv5GGw==;fakeToken;",
|
||||
resourceToken: "type=resource&ver=1&sig=2dIP+CdIfT1ScwHWdv5GGw==;fakeToken",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -30,6 +30,10 @@ export function parseResourceTokenConnectionString(connectionString: string): Pa
|
|||
}
|
||||
});
|
||||
|
||||
if (resourceToken && resourceToken.endsWith(";")) {
|
||||
resourceToken = resourceToken.substring(0, resourceToken.length - 1);
|
||||
}
|
||||
|
||||
return {
|
||||
accountEndpoint,
|
||||
collectionId,
|
||||
|
|
Loading…
Reference in New Issue