Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always include Content-Type header in management requests #158

Merged
merged 3 commits into from
Nov 8, 2018

Conversation

crgk
Copy link
Contributor

@crgk crgk commented Oct 23, 2018

Following up on the conversation in #152, this change refactors the RestClient constructor so that base_headers always includes the 'Content-Type' header. Tests ensure that the header is included on requests, except for file_post, which should remove it.

@@ -57,7 +55,6 @@ def post(self, url, data=None):
headers = self.base_headers.copy()
headers.update({
'Authorization': 'Bearer %s' % self.jwt,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like the authorization header is present on all the http methods. I think this one should be part of base headers too

@crgk crgk force-pushed the management-content-type-headers branch from 2980645 to 3545e39 Compare October 23, 2018 23:09
@lbalmaceda
Copy link
Contributor

@crgk please rebase and fix the conflicts. Also change the string formatting to stop using % and start using "{}.format()". I saw a few places where you generate the header value and use % (extra points if you search all occurrences in code)

@lbalmaceda lbalmaceda added this to the v3-Next milestone Nov 7, 2018
@crgk crgk force-pushed the management-content-type-headers branch from 3545e39 to 647be5a Compare November 8, 2018 15:23
@crgk
Copy link
Contributor Author

crgk commented Nov 8, 2018

@lbalmaceda Updated. I only see one other place that was still using % formatting, and it was from my other PR 😬

Should be all sorted out now.

Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lbalmaceda lbalmaceda merged commit bed4873 into auth0:master Nov 8, 2018
@lbalmaceda lbalmaceda modified the milestones: v3-Next, 3.4.0 Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants