nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: minio/minio-js
Pull request #664 (2018-01-16 17:42:20)

Remove IsAmazonEndpoint check in IsValidEndpoint
This is done to support all Amazon endpoints.


Patch:
diff --git a/src/main/helpers.js b/src/main/helpers.js
index 9cc13ae..ebf327b 100644
--- a/src/main/helpers.js
+++ b/src/main/helpers.js
@@ -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
 }


Test patch:
diff --git a/src/test/unit/test.js b/src/test/unit/test.js
index 55e022d..de83c97 100644
--- a/src/test/unit/test.js
+++ b/src/test/unit/test.js
@@ -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)