File tree Expand file tree Collapse file tree 12 files changed +139
-11
lines changed Expand file tree Collapse file tree 12 files changed +139
-11
lines changed Original file line number Diff line number Diff line change 9
9
### Bugs Fixed
10
10
11
11
- Fixed a hang issue in BlobClient.downloadToBuffer when encountering transient network failure.
12
+ - Refined URL parsing method to let it be able to correctly parse URLs with account name in path.
12
13
13
14
## 12.11.0 (2022-07-08)
14
15
Original file line number Diff line number Diff line change @@ -210,3 +210,28 @@ export const StorageBlobLoggingAllowedQueryParameters = [
210
210
export const BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption" ;
211
211
export const BlobDoesNotUseCustomerSpecifiedEncryption =
212
212
"BlobDoesNotUseCustomerSpecifiedEncryption" ;
213
+
214
+ /// List of ports used for path style addressing.
215
+ /// Path style addressing means that storage account is put in URI's Path segment in instead of in host.
216
+ export const PathStylePorts = [
217
+ "10000" ,
218
+ "10001" ,
219
+ "10002" ,
220
+ "10003" ,
221
+ "10004" ,
222
+ "10100" ,
223
+ "10101" ,
224
+ "10102" ,
225
+ "10103" ,
226
+ "10104" ,
227
+ "11000" ,
228
+ "11001" ,
229
+ "11002" ,
230
+ "11003" ,
231
+ "11004" ,
232
+ "11100" ,
233
+ "11101" ,
234
+ "11102" ,
235
+ "11103" ,
236
+ "11104" ,
237
+ ] ;
Original file line number Diff line number Diff line change @@ -32,7 +32,12 @@ import {
32
32
ClearRange ,
33
33
BlobPropertiesInternal ,
34
34
} from "../generated/src/models" ;
35
- import { DevelopmentConnectionString , HeaderConstants , URLConstants } from "./constants" ;
35
+ import {
36
+ DevelopmentConnectionString ,
37
+ HeaderConstants ,
38
+ PathStylePorts ,
39
+ URLConstants ,
40
+ } from "./constants" ;
36
41
import {
37
42
Tags ,
38
43
ObjectReplicationPolicy ,
@@ -603,8 +608,11 @@ export function isIpEndpointStyle(parsedUrl: URLBuilder): boolean {
603
608
// Case 2: localhost(:port), use broad regex to match port part.
604
609
// Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
605
610
// For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
606
- return / ^ .* : .* : .* $ | ^ l o c a l h o s t ( : [ 0 - 9 ] + ) ? $ | ^ ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ( \. ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ) { 3 } ( : [ 0 - 9 ] + ) ? $ / . test (
607
- host
611
+ return (
612
+ / ^ .* : .* : .* $ | ^ l o c a l h o s t ( : [ 0 - 9 ] + ) ? $ | ^ ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ( \. ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ) { 3 } ( : [ 0 - 9 ] + ) ? $ / . test (
613
+ host
614
+ ) ||
615
+ ( parsedUrl . getPort ( ) !== undefined && PathStylePorts . includes ( parsedUrl . getPort ( ) ! ) )
608
616
) ;
609
617
}
610
618
Original file line number Diff line number Diff line change 12
12
### Bugs Fixed
13
13
14
14
- Correted permission string parsing in DataLakePathClient.setPermissions() and DataLakePathClient.getAccessControl().
15
+ - Refined URL parsing method to let it be able to correctly parse URLs with account name in path.
15
16
16
17
## 12.10.0 (2022-07-08)
17
18
Original file line number Diff line number Diff line change @@ -229,3 +229,28 @@ export const PathResultTypeConstants = {
229
229
FileResourceType : "file" ,
230
230
DirectoryResourceType : "directory" ,
231
231
} ;
232
+
233
+ /// List of ports used for path style addressing.
234
+ /// Path style addressing means that storage account is put in URI's Path segment in instead of in host.
235
+ export const PathStylePorts = [
236
+ "10000" ,
237
+ "10001" ,
238
+ "10002" ,
239
+ "10003" ,
240
+ "10004" ,
241
+ "10100" ,
242
+ "10101" ,
243
+ "10102" ,
244
+ "10103" ,
245
+ "10104" ,
246
+ "11000" ,
247
+ "11001" ,
248
+ "11002" ,
249
+ "11003" ,
250
+ "11004" ,
251
+ "11100" ,
252
+ "11101" ,
253
+ "11102" ,
254
+ "11103" ,
255
+ "11104" ,
256
+ ] ;
Original file line number Diff line number Diff line change 9
9
DevelopmentConnectionString ,
10
10
EncryptionAlgorithmAES25 ,
11
11
HeaderConstants ,
12
+ PathStylePorts ,
12
13
UrlConstants ,
13
14
} from "./constants" ;
14
15
@@ -571,8 +572,11 @@ export function isIpEndpointStyle(parsedUrl: URLBuilder): boolean {
571
572
// Case 2: localhost(:port), use broad regex to match port part.
572
573
// Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
573
574
// For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
574
- return / ^ .* : .* : .* $ | ^ l o c a l h o s t ( : [ 0 - 9 ] + ) ? $ | ^ ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ( \. ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ) { 3 } ( : [ 0 - 9 ] + ) ? $ / . test (
575
- host
575
+ return (
576
+ / ^ .* : .* : .* $ | ^ l o c a l h o s t ( : [ 0 - 9 ] + ) ? $ | ^ ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ( \. ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ) { 3 } ( : [ 0 - 9 ] + ) ? $ / . test (
577
+ host
578
+ ) ||
579
+ ( parsedUrl . getPort ( ) !== undefined && PathStylePorts . includes ( parsedUrl . getPort ( ) ! ) )
576
580
) ;
577
581
}
578
582
Original file line number Diff line number Diff line change 9
9
### Bugs Fixed
10
10
11
11
- Fixed a hang issue in ShareFileClient.downloadToBuffer when encountering transient network failure.
12
+ - Refined URL parsing method to let it be able to correctly parse URLs with account name in path.
12
13
13
14
### Other Changes
14
15
Original file line number Diff line number Diff line change @@ -136,3 +136,28 @@ export const StorageFileLoggingAllowedQueryParameters = [
136
136
"copyid" ,
137
137
"restype" ,
138
138
] ;
139
+
140
+ /// List of ports used for path style addressing.
141
+ /// Path style addressing means that storage account is put in URI's Path segment in instead of in host.
142
+ export const PathStylePorts = [
143
+ "10000" ,
144
+ "10001" ,
145
+ "10002" ,
146
+ "10003" ,
147
+ "10004" ,
148
+ "10100" ,
149
+ "10101" ,
150
+ "10102" ,
151
+ "10103" ,
152
+ "10104" ,
153
+ "11000" ,
154
+ "11001" ,
155
+ "11002" ,
156
+ "11003" ,
157
+ "11004" ,
158
+ "11100" ,
159
+ "11101" ,
160
+ "11102" ,
161
+ "11103" ,
162
+ "11104" ,
163
+ ] ;
Original file line number Diff line number Diff line change 4
4
import { AbortSignalLike } from "@azure/abort-controller" ;
5
5
import { HttpHeaders , isNode , URLBuilder } from "@azure/core-http" ;
6
6
import { HttpAuthorization } from "../models" ;
7
- import { HeaderConstants , URLConstants } from "./constants" ;
7
+ import { HeaderConstants , PathStylePorts , URLConstants } from "./constants" ;
8
8
9
9
/**
10
10
* Reserved URL characters must be properly escaped for Storage services like Blob or File.
@@ -442,8 +442,11 @@ export function isIpEndpointStyle(parsedUrl: URLBuilder): boolean {
442
442
// Case 2: localhost(:port), use broad regex to match port part.
443
443
// Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
444
444
// For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
445
- return / ^ .* : .* : .* $ | ^ l o c a l h o s t ( : [ 0 - 9 ] + ) ? $ | ^ ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ( \. ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ) { 3 } ( : [ 0 - 9 ] + ) ? $ / . test (
446
- host
445
+ return (
446
+ / ^ .* : .* : .* $ | ^ l o c a l h o s t ( : [ 0 - 9 ] + ) ? $ | ^ ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ( \. ( \d | [ 1 - 9 ] \d | 1 \d \d | 2 [ 0 - 4 ] \d | 2 5 [ 0 - 5 ] ) ) { 3 } ( : [ 0 - 9 ] + ) ? $ / . test (
447
+ host
448
+ ) ||
449
+ ( parsedUrl . getPort ( ) !== undefined && PathStylePorts . includes ( parsedUrl . getPort ( ) ! ) )
447
450
) ;
448
451
}
449
452
Original file line number Diff line number Diff line change 8
8
9
9
### Bugs Fixed
10
10
11
+ - Refined URL parsing method to let it be able to correctly parse URLs with account name in path.
12
+
11
13
### Other Changes
12
14
13
15
## 12.10.0 (2022-07-08)
You can’t perform that action at this time.
0 commit comments