@@ -122,39 +122,39 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
122
122
123
123
const response : Models . BlobGetPropertiesResponse = againstMetadata
124
124
? {
125
- statusCode : 200 ,
126
- metadata : res . metadata ,
127
- eTag : res . properties . etag ,
128
- requestId : context . contextId ,
129
- version : BLOB_API_VERSION ,
130
- date : context . startTime ,
131
- clientRequestId : options . requestId ,
132
- contentLength : res . properties . contentLength ,
133
- lastModified : res . properties . lastModified
134
- }
125
+ statusCode : 200 ,
126
+ metadata : res . metadata ,
127
+ eTag : res . properties . etag ,
128
+ requestId : context . contextId ,
129
+ version : BLOB_API_VERSION ,
130
+ date : context . startTime ,
131
+ clientRequestId : options . requestId ,
132
+ contentLength : res . properties . contentLength ,
133
+ lastModified : res . properties . lastModified
134
+ }
135
135
: {
136
- statusCode : 200 ,
137
- metadata : res . metadata ,
138
- isIncrementalCopy : res . properties . incrementalCopy ,
139
- eTag : res . properties . etag ,
140
- requestId : context . contextId ,
141
- version : BLOB_API_VERSION ,
142
- date : context . startTime ,
143
- acceptRanges : "bytes" ,
144
- blobCommittedBlockCount :
145
- res . properties . blobType === Models . BlobType . AppendBlob
146
- ? res . blobCommittedBlockCount
147
- : undefined ,
148
- isServerEncrypted : true ,
149
- clientRequestId : options . requestId ,
150
- ...res . properties ,
151
- cacheControl : context . request ! . getQuery ( "rscc" ) ?? res . properties . cacheControl ,
152
- contentDisposition : context . request ! . getQuery ( "rscd" ) ?? res . properties . contentDisposition ,
153
- contentEncoding : context . request ! . getQuery ( "rsce" ) ?? res . properties . contentEncoding ,
154
- contentLanguage : context . request ! . getQuery ( "rscl" ) ?? res . properties . contentLanguage ,
155
- contentType : context . request ! . getQuery ( "rsct" ) ?? res . properties . contentType ,
156
- tagCount : res . properties . tagCount ,
157
- } ;
136
+ statusCode : 200 ,
137
+ metadata : res . metadata ,
138
+ isIncrementalCopy : res . properties . incrementalCopy ,
139
+ eTag : res . properties . etag ,
140
+ requestId : context . contextId ,
141
+ version : BLOB_API_VERSION ,
142
+ date : context . startTime ,
143
+ acceptRanges : "bytes" ,
144
+ blobCommittedBlockCount :
145
+ res . properties . blobType === Models . BlobType . AppendBlob
146
+ ? res . blobCommittedBlockCount
147
+ : undefined ,
148
+ isServerEncrypted : true ,
149
+ clientRequestId : options . requestId ,
150
+ ...res . properties ,
151
+ cacheControl : context . request ! . getQuery ( "rscc" ) ?? res . properties . cacheControl ,
152
+ contentDisposition : context . request ! . getQuery ( "rscd" ) ?? res . properties . contentDisposition ,
153
+ contentEncoding : context . request ! . getQuery ( "rsce" ) ?? res . properties . contentEncoding ,
154
+ contentLanguage : context . request ! . getQuery ( "rscl" ) ?? res . properties . contentLanguage ,
155
+ contentType : context . request ! . getQuery ( "rsct" ) ?? res . properties . contentType ,
156
+ tagCount : res . properties . tagCount ,
157
+ } ;
158
158
159
159
return response ;
160
160
}
@@ -329,12 +329,10 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
329
329
const metadata = convertRawHeadersToMetadata (
330
330
blobCtx . request ! . getRawHeaders ( )
331
331
) ;
332
-
333
- if ( metadata != undefined )
334
- {
332
+
333
+ if ( metadata != undefined ) {
335
334
Object . entries ( metadata ) . forEach ( ( [ key , value ] ) => {
336
- if ( key . includes ( "-" ) )
337
- {
335
+ if ( key . includes ( "-" ) ) {
338
336
throw StorageErrorFactory . getInvalidMetadata ( context . contextId ! ) ;
339
337
}
340
338
} ) ;
@@ -664,7 +662,8 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
664
662
throw StorageErrorFactory . getBlobNotFound ( context . contextId ! ) ;
665
663
}
666
664
667
- if ( sourceAccount !== blobCtx . account ) {
665
+ const sig = url . searchParams . get ( "sig" ) ;
666
+ if ( ( sourceAccount !== blobCtx . account ) || ( sig !== null ) ) {
668
667
await this . validateCopySource ( copySource , sourceAccount , context ) ;
669
668
}
670
669
@@ -1103,7 +1102,7 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
1103
1102
tagCount : getBlobTagsCount ( blob . blobTags ) ,
1104
1103
isServerEncrypted : true ,
1105
1104
clientRequestId : options . requestId ,
1106
- creationTime :blob . properties . creationTime ,
1105
+ creationTime : blob . properties . creationTime ,
1107
1106
blobCommittedBlockCount :
1108
1107
blob . properties . blobType === Models . BlobType . AppendBlob
1109
1108
? ( blob . committedBlocksInOrder || [ ] ) . length
@@ -1176,9 +1175,9 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
1176
1175
contentLength <= 0
1177
1176
? [ ]
1178
1177
: this . rangesManager . fillZeroRanges ( blob . pageRangesInOrder , {
1179
- start : rangeStart ,
1180
- end : rangeEnd
1181
- } ) ;
1178
+ start : rangeStart ,
1179
+ end : rangeEnd
1180
+ } ) ;
1182
1181
1183
1182
const bodyGetter = async ( ) => {
1184
1183
return this . extentStore . readExtents (
@@ -1233,7 +1232,7 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
1233
1232
blobContentMD5 : blob . properties . contentMD5 ,
1234
1233
tagCount : getBlobTagsCount ( blob . blobTags ) ,
1235
1234
isServerEncrypted : true ,
1236
- creationTime :blob . properties . creationTime ,
1235
+ creationTime : blob . properties . creationTime ,
1237
1236
clientRequestId : options . requestId
1238
1237
} ;
1239
1238
@@ -1243,7 +1242,7 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
1243
1242
public async query (
1244
1243
options : Models . BlobQueryOptionalParams ,
1245
1244
context : Context
1246
- ) : Promise < Models . BlobQueryResponse > {
1245
+ ) : Promise < Models . BlobQueryResponse > {
1247
1246
throw new NotImplementedError ( context . contextId ) ;
1248
1247
}
1249
1248
@@ -1266,13 +1265,13 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
1266
1265
) ;
1267
1266
1268
1267
const response : Models . BlobGetTagsResponse = {
1269
- statusCode : 200 ,
1270
- blobTagSet : tags === undefined ? [ ] : tags . blobTagSet ,
1271
- requestId : context . contextId ,
1272
- version : BLOB_API_VERSION ,
1273
- date : context . startTime ,
1274
- clientRequestId : options . requestId ,
1275
- } ;
1268
+ statusCode : 200 ,
1269
+ blobTagSet : tags === undefined ? [ ] : tags . blobTagSet ,
1270
+ requestId : context . contextId ,
1271
+ version : BLOB_API_VERSION ,
1272
+ date : context . startTime ,
1273
+ clientRequestId : options . requestId ,
1274
+ } ;
1276
1275
1277
1276
return response ;
1278
1277
}
@@ -1315,18 +1314,18 @@ export default class BlobHandler extends BaseHandler implements IBlobHandler {
1315
1314
return response ;
1316
1315
}
1317
1316
1318
- private NewUriFromCopySource ( copySource : string , context : Context ) : URL {
1319
- try {
1320
- return new URL ( copySource )
1321
- }
1322
- catch
1323
- {
1324
- throw StorageErrorFactory . getInvalidHeaderValue (
1325
- context . contextId ,
1326
- {
1327
- HeaderName : "x-ms-copy-source" ,
1328
- HeaderValue : copySource
1329
- } )
1330
- }
1317
+ private NewUriFromCopySource ( copySource : string , context : Context ) : URL {
1318
+ try {
1319
+ return new URL ( copySource )
1320
+ }
1321
+ catch
1322
+ {
1323
+ throw StorageErrorFactory . getInvalidHeaderValue (
1324
+ context . contextId ,
1325
+ {
1326
+ HeaderName : "x-ms-copy-source" ,
1327
+ HeaderValue : copySource
1328
+ } )
1329
+ }
1331
1330
}
1332
1331
}
0 commit comments