Merge lp://staging/~elachuni/piston-mini-client/oauthlib-fix into lp://staging/piston-mini-client

Proposed by Anthony Lenton
Status: Merged
Approved by: Barry Warsaw
Approved revision: 71
Merged at revision: 70
Proposed branch: lp://staging/~elachuni/piston-mini-client/oauthlib-fix
Merge into: lp://staging/piston-mini-client
Diff against target: 257 lines (+82/-18)
7 files modified
.bzrignore (+1/-0)
piston_mini_client/__init__.py (+1/-1)
piston_mini_client/auth.py (+7/-2)
piston_mini_client/tests/test_auth.py (+59/-1)
piston_mini_client/tests/test_failhandlers.py (+1/-1)
piston_mini_client/tests/test_log_to_file.py (+1/-1)
piston_mini_client/tests/test_resource.py (+12/-12)
To merge this branch: bzr merge lp://staging/~elachuni/piston-mini-client/oauthlib-fix
Reviewer Review Type Date Requested Status
Barry Warsaw Approve
Review via email: mp+149931@code.staging.launchpad.net

Commit message

Fixed two issues related to OAuth authentication with oauthlib.

Description of the change

This branch fixes two issues related to OAuth authentication with oauthlib:
 - oauthlib refuses to sign requests with a urlencoded body if the Content-Type header isn't set to 'application/x-www-form-urlencoded'. This check is case-sensitive, so the header can't be 'Content-type' or 'content-type'. Submitted this issue as https://github.com/idan/oauthlib/issues/121

 - oauthlib also refuses to sign requests with a Content-Type header set to 'application/x-www-form-urlencoded' if the body is None. Submitted this issue as https://github.com/idan/oauthlib/issues/122 thinking that the issue was if the body was blank (''), but it turns out that it *only* works with '' iff Content-Type is 'application/x-www-form-urlencoded', otherwise it needs to be None.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

<barry> one suggestion: use example.{com,net,org} urls instead of
        bathsandco.com since the formers are actually reserved for exactly
        that purpose (i.e. they will never resolve)
<achuni> true [16:31]
<achuni> will do, even though we're mocking out httplib and will never attempt
         to resolve
<achuni> httplib2
* barry nods

review: Approve
72. By Anthony Lenton

Use example.com for tests, and work with 0.3.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches