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

Bunjiboys jwks content type #587

Merged
merged 1 commit into from
Jan 12, 2019
Merged

Conversation

tpazderka
Copy link
Collaborator

  • Any changes relevant to users are recorded in the CHANGELOG.md.
  • The documentation has been updated, if necessary.

Copy link
Collaborator

@schlenk schlenk left a comment

Choose a reason for hiding this comment

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

The case sensitive/insensitive parts is a separate issue, we probably fail to do it right elsewhere too.

@@ -222,7 +222,7 @@ def _parse_remote_response(self, response):
"""
# Check if the content type is the right one.
try:
if response.headers["Content-Type"] != 'application/json':
if not response.headers["Content-Type"].startswith('application/json'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

That header part 'application/json' is case insensitive (RFC 7231 3.1.1.1)
So unless response.headers normalizes it, this might fail for some strange responses.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that is correct. requests do not normalize the value of the header, just the key.
We are not doing much of a content type comparison, so I will add lower here.

@codecov-io
Copy link

codecov-io commented Jan 12, 2019

Codecov Report

Merging #587 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #587      +/-   ##
==========================================
+ Coverage   60.18%   60.24%   +0.05%     
==========================================
  Files          62       62              
  Lines       11266    11266              
  Branches     1985     1985              
==========================================
+ Hits         6781     6787       +6     
+ Misses       3930     3924       -6     
  Partials      555      555
Impacted Files Coverage Δ
src/oic/utils/keyio.py 67.08% <100%> (+0.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a9c27e...de86147. Read the comment docs.

@tpazderka tpazderka merged commit 19c6ba4 into master Jan 12, 2019
@tpazderka tpazderka deleted the bunjiboys-jwks-content-type branch January 12, 2019 20:08
mblomdahl added a commit to mkdevops-se/pyoidc that referenced this pull request Feb 22, 2019
andrewkrug pushed a commit to mozilla-iam/pyoidc that referenced this pull request Jun 6, 2019
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.

4 participants