@@ -13,7 +13,7 @@ export default class BlobSharedKeyAuthenticator implements IAuthenticator {
1313 public constructor (
1414 private readonly dataStore : IAccountDataStore ,
1515 private readonly logger : ILogger
16- ) { }
16+ ) { }
1717
1818 public async validate (
1919 req : IRequest ,
@@ -77,8 +77,8 @@ export default class BlobSharedKeyAuthenticator implements IAuthenticator {
7777 const stringToSign : string =
7878 [
7979 req . getMethod ( ) . toUpperCase ( ) ,
80- this . getHeaderValueToSign ( req , HeaderConstants . CONTENT_ENCODING ) ,
8180 this . getHeaderValueToSign ( req , HeaderConstants . CONTENT_LANGUAGE ) ,
81+ this . getHeaderValueToSign ( req , HeaderConstants . CONTENT_ENCODING ) ,
8282 this . getHeaderValueToSign ( req , HeaderConstants . CONTENT_LENGTH ) ,
8383 this . getHeaderValueToSign ( req , HeaderConstants . CONTENT_MD5 ) ,
8484 this . getHeaderValueToSign ( req , HeaderConstants . CONTENT_TYPE ) ,
@@ -137,10 +137,9 @@ export default class BlobSharedKeyAuthenticator implements IAuthenticator {
137137 }
138138 }
139139
140- if ( context . context . isSecondary && blobContext . authenticationPath ?. indexOf ( account ) === 1 )
141- {
142- // JS/.net Track2 SDK will generate stringToSign from IP style URI with "-secondary" in authenticationPath, so will also compare signature with this kind stringToSign
143- const stringToSign_secondary : string =
140+ if ( context . context . isSecondary && blobContext . authenticationPath ?. indexOf ( account ) === 1 ) {
141+ // JS/.net Track2 SDK will generate stringToSign from IP style URI with "-secondary" in authenticationPath, so will also compare signature with this kind stringToSign
142+ const stringToSign_secondary : string =
144143 [
145144 req . getMethod ( ) . toUpperCase ( ) ,
146145 this . getHeaderValueToSign ( req , HeaderConstants . CONTENT_ENCODING ) ,
@@ -171,7 +170,7 @@ export default class BlobSharedKeyAuthenticator implements IAuthenticator {
171170 blobContext . contextId
172171 ) ;
173172
174- const signature1_secondary = computeHMACSHA256 ( stringToSign_secondary , accountProperties . key1 ) ;
173+ const signature1_secondary = computeHMACSHA256 ( stringToSign_secondary , accountProperties . key1 ) ;
175174 const authValue1_secondary = `SharedKey ${ account } :${ signature1_secondary } ` ;
176175 this . logger . info (
177176 `BlobSharedKeyAuthenticator:validate() Calculated authentication header based on key1 and stringToSign with "-secondary": ${ authValue1_secondary } ` ,
0 commit comments