File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
packages/cloudfront-signer/src Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -366,6 +366,23 @@ describe("getSignedUrl", () => {
366
366
const signatureQueryParam = denormalizeBase64 ( signature ) ;
367
367
expect ( verifySignature ( signatureQueryParam , policy ) ) . toBeTruthy ( ) ;
368
368
} ) ;
369
+
370
+ describe ( "should not normalize the URL" , ( ) => {
371
+ it . each ( [ "." , ".." ] ) ( "with '%s'" , ( folderName ) => {
372
+ const urlWithFolderName = `https://d111111abcdef8.cloudfront.net/public-content/${ folderName } /private-content/private.jpeg` ;
373
+ const policy = JSON . stringify ( { Statement : [ { Resource : urlWithFolderName } ] } ) ;
374
+ const result = getSignedUrl ( {
375
+ keyPairId,
376
+ privateKey,
377
+ policy,
378
+ passphrase,
379
+ } ) ;
380
+ const signature = createSignature ( policy ) ;
381
+ expect ( result . startsWith ( urlWithFolderName ) ) . toBeTruthy ( ) ;
382
+ const signatureQueryParam = denormalizeBase64 ( signature ) ;
383
+ expect ( verifySignature ( signatureQueryParam , policy ) ) . toBeTruthy ( ) ;
384
+ } ) ;
385
+ } ) ;
369
386
} ) ;
370
387
371
388
describe ( "getSignedCookies" , ( ) => {
You can’t perform that action at this time.
0 commit comments