Skip to content

Commit

Permalink
Remove IsAmazonEndpoint check in IsValidEndpoint (#664)
Browse files Browse the repository at this point in the history
This is done to support all Amazon endpoints.
  • Loading branch information
kannappanr authored Jan 17, 2018
1 parent 9afc484 commit bb5c105
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/main/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ export function isValidEndpoint(endpoint) {
if (!isValidDomain(endpoint) && !isValidIP(endpoint)) {
return false
}
// Endpoint matches amazon, make sure its 's3.amazonaws.com'
if (endpoint.match('.amazonaws.com$') || endpoint.match('.amazonaws.com.cn$')) {
if (!isAmazonEndpoint(endpoint)) {
return false
}
}
// Return true.
return true
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ describe('Helpers', () => {
it('should validate for s3 china', () => {
assert.equal(isValidEndpoint('s3.cn-north-1.amazonaws.com.cn'), true)
})
it('should fail for invalid endpoint', () => {
assert.equal(isValidEndpoint('s3-us-west-2.amazonaws.com'), false)
it('should validate for us-west-2', () => {
assert.equal(isValidEndpoint('s3-us-west-2.amazonaws.com'), true)
})
it('should fail for invalid endpoint characters', () => {
assert.equal(isValidEndpoint('111.#2.11'), false)
Expand Down

0 comments on commit bb5c105

Please sign in to comment.