Skip to content

Commit

Permalink
Test dot segment in S3 URI Label (#4659)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Jul 10, 2024
1 parent b4e67d5 commit 54829e3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/services/s3.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3944,4 +3944,34 @@ describe('AWS.S3', function() {
});
});
});

describe('Dot Segment in URI Label', function() {
it('S3PreservesLeadingDotSegmentInUriLabel', function(done) {
s3 = new AWS.S3({region: 'us-west-2'});
helpers.mockHttpResponse(200, {}, '');
var request = s3.getObject({
Bucket: 'bucket',
Key: '../key.txt'
});
request.send(function(err, data) {
expect(err).to.not.exist;
expect(request.httpRequest.path).to.equal('/../key.txt');
done();
});
});

it('S3PreservesEmbeddedDotSegmentInUriLabel', function(done) {
s3 = new AWS.S3({region: 'us-west-2'});
helpers.mockHttpResponse(200, {}, '');
var request = s3.getObject({
Bucket: 'bucket',
Key: 'foo/../key.txt'
});
request.send(function(err, data) {
expect(err).to.not.exist;
expect(request.httpRequest.path).to.equal('/foo/../key.txt');
done();
});
});
});
});

0 comments on commit 54829e3

Please sign in to comment.