-
Notifications
You must be signed in to change notification settings - Fork 258
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
Conversation
bf53855
to
59f4df1
Compare
There was a problem hiding this 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.
src/oic/utils/keyio.py
Outdated
@@ -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'): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
59f4df1
to
20d984a
Compare
20d984a
to
de86147
Compare
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
CHANGELOG.md
.