@azure/storage-blob 12.20.0-alpha.20230720.6 → 12.20.0-alpha.20230801.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
@@ -457,7 +457,11 @@ function extractConnectionStringParts(connectionString) {
|
|
457
457
|
else {
|
458
458
|
// SAS connection string
|
459
459
|
let accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
|
460
|
-
|
460
|
+
let accountName = getValueInConnString(connectionString, "AccountName");
|
461
|
+
// if accountName is empty, try to read it from BlobEndpoint
|
462
|
+
if (!accountName) {
|
463
|
+
accountName = getAccountNameFromUrl(blobEndpoint);
|
464
|
+
}
|
461
465
|
if (!blobEndpoint) {
|
462
466
|
throw new Error("Invalid BlobEndpoint in the provided SAS Connection String");
|
463
467
|
}
|
@@ -778,10 +782,10 @@ function getAccountNameFromUrl(url) {
|
|
778
782
|
function isIpEndpointStyle(parsedUrl) {
|
779
783
|
const host = parsedUrl.host;
|
780
784
|
// Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'.
|
781
|
-
// Case 2: localhost(:port), use broad regex to match port part.
|
785
|
+
// Case 2: localhost(:port) or host.docker.internal, use broad regex to match port part.
|
782
786
|
// Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
|
783
787
|
// For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
|
784
|
-
return (/^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||
|
788
|
+
return (/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||
|
785
789
|
(Boolean(parsedUrl.port) && PathStylePorts.includes(parsedUrl.port)));
|
786
790
|
}
|
787
791
|
/**
|