File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -3944,4 +3944,34 @@ describe('AWS.S3', function() {
3944
3944
} ) ;
3945
3945
} ) ;
3946
3946
} ) ;
3947
+
3948
+ describe ( 'Dot Segment in URI Label' , function ( ) {
3949
+ it ( 'S3PreservesLeadingDotSegmentInUriLabel' , function ( done ) {
3950
+ s3 = new AWS . S3 ( { region : 'us-west-2' } ) ;
3951
+ helpers . mockHttpResponse ( 200 , { } , '' ) ;
3952
+ var request = s3 . getObject ( {
3953
+ Bucket : 'bucket' ,
3954
+ Key : '../key.txt'
3955
+ } ) ;
3956
+ request . send ( function ( err , data ) {
3957
+ expect ( err ) . to . not . exist ;
3958
+ expect ( request . httpRequest . path ) . to . equal ( '/../key.txt' ) ;
3959
+ done ( ) ;
3960
+ } ) ;
3961
+ } ) ;
3962
+
3963
+ it ( 'S3PreservesEmbeddedDotSegmentInUriLabel' , function ( done ) {
3964
+ s3 = new AWS . S3 ( { region : 'us-west-2' } ) ;
3965
+ helpers . mockHttpResponse ( 200 , { } , '' ) ;
3966
+ var request = s3 . getObject ( {
3967
+ Bucket : 'bucket' ,
3968
+ Key : 'foo/../key.txt'
3969
+ } ) ;
3970
+ request . send ( function ( err , data ) {
3971
+ expect ( err ) . to . not . exist ;
3972
+ expect ( request . httpRequest . path ) . to . equal ( '/foo/../key.txt' ) ;
3973
+ done ( ) ;
3974
+ } ) ;
3975
+ } ) ;
3976
+ } ) ;
3947
3977
} ) ;
You can’t perform that action at this time.
0 commit comments