nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: minio/minio-go
Pull request #1115 (2019-05-29 14:19:24)

Add slash to defaultIAMSecurityCredsPath
Ref #1114 


Patch:
diff --git a/pkg/credentials/iam_aws.go b/pkg/credentials/iam_aws.go
index 3107852..5732f2e 100644
--- a/pkg/credentials/iam_aws.go
+++ b/pkg/credentials/iam_aws.go
@@ -53,7 +53,7 @@ type IAM struct {
 const (
 	defaultIAMRoleEndpoint      = "http://169.254.169.254"
 	defaultECSRoleEndpoint      = "http://169.254.170.2"
-	defaultIAMSecurityCredsPath = "/latest/meta-data/iam/security-credentials"
+	defaultIAMSecurityCredsPath = "/latest/meta-data/iam/security-credentials/"
 )
 
 // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html
diff --git a/retry.go b/retry.go
index 94176b0..2c608ba 100644
--- a/retry.go
+++ b/retry.go
@@ -111,6 +111,9 @@ func isHTTPReqErrorRetryable(err error) bool {
 		} else if strings.Contains(err.Error(), "net/http: HTTP/1.x transport connection broken") {
 			// If error is transport connection broken, retry.
 			return true
+		} else if strings.Contains(err.Error(), "net/http: timeout awaiting response headers") {
+			// Retry errors due to server not sending the response before timeout
+			return true
 		}
 	}
 	return false


Test patch:
diff --git a/pkg/credentials/iam_aws_test.go b/pkg/credentials/iam_aws_test.go
index b33f9bd..90f9806 100644
--- a/pkg/credentials/iam_aws_test.go
+++ b/pkg/credentials/iam_aws_test.go
@@ -67,7 +67,7 @@ func initTestServerNoRoles() *httptest.Server {
 
 func initTestServer(expireOn string, failAssume bool) *httptest.Server {
 	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-		if r.URL.Path == "/latest/meta-data/iam/security-credentials" {
+		if r.URL.Path == "/latest/meta-data/iam/security-credentials/" {
 			fmt.Fprintln(w, "RoleName")
 		} else if r.URL.Path == "/latest/meta-data/iam/security-credentials/RoleName" {
 			if failAssume {