-
Notifications
You must be signed in to change notification settings - Fork 259
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
Fixed parsing for zero content length response #812
Conversation
Codecov Report
@@ Coverage Diff @@
## master #812 +/- ##
==========================================
+ Coverage 63.72% 63.84% +0.12%
==========================================
Files 64 64
Lines 11856 11860 +4
Branches 2411 2413 +2
==========================================
+ Hits 7555 7572 +17
+ Misses 3703 3686 -17
- Partials 598 602 +4
Continue to review full report at Codecov.
|
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 new code should be covered by tests.
Mocks zero content length response
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 tests should be unittests, so you should write a test for parse_request_response
and verify_header
functions that cover the changes introduced here.
@tpazderka Awaiting review. |
When will be the new version released? zamzterz/Flask-pyoidc/#801 depends on it. |
The
content-type
in the header is optional when the payload has zero content length. See, Should Content-Type header be present when the message body is empty?.This happens when the request to IdP is made for revoking tokens. In that case, IdP returns a
200 OK
status code with no body and noContent-Type
in the response header.See, About the revoke request.
To parse responses with zero content length, just check if the value of
content-length
is 0 and return the status code if it does.