Skip to content

Commit

Permalink
Add slash to defaultIAMSecurityCredsPath (#1115)
Browse files Browse the repository at this point in the history
Also add slash to security credential url at test
  • Loading branch information
shernshiou authored and kannappanr committed May 29, 2019
1 parent de69c0e commit 952dac3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/credentials/iam_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/credentials/iam_aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 952dac3

Please sign in to comment.