Skip to content

Comments

Use application/json as content type when returning credentials#115

Merged
patricksanders merged 1 commit intoNetflix:masterfrom
dleen:master
Mar 17, 2022
Merged

Use application/json as content type when returning credentials#115
patricksanders merged 1 commit intoNetflix:masterfrom
dleen:master

Conversation

@dleen
Copy link
Contributor

@dleen dleen commented Mar 16, 2022

The credentials are returned as a JSON object so update the content type
to match instead of text/plain.

@patricksanders
Copy link
Contributor

I misled you with my recommendation earlier. 🤦 TokenMiddleware() is used for IMDSv2 token validation/enforcement. Making the change there only effects the IMDS endpoint because the ECS metadata service doesn't use the same token dance as IMDS.

I just pushed a change to your branch that moves the header setting into both (IMDS and ECS) credential handlers. I still need to update/add tests for the changed functionality, but manual testing showed success.

Use application/json as content type when returning credentials

The credentials are returned as a JSON object so update the content type
to match instead of text/plain.

move content-type to handlers for cred endpoints

update pre-commit config to use https for git, remove content-type check from test

set content-type in handlers instead of middleware
@patricksanders patricksanders merged commit 4d87188 into Netflix:master Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants