Merge lp:~wallyworld/goetveld/auth-cookie-fix into lp:goetveld
Status: | Merged |
---|---|
Merged at revision: | 42 |
Proposed branch: | lp:~wallyworld/goetveld/auth-cookie-fix |
Merge into: | lp:goetveld |
Diff against target: |
285 lines (+55/-32) 9 files modified
auth.go (+34/-9) bazaar.go (+2/-3) doc.go (+0/-1) form.go (+4/-4) html/parse.go (+1/-1) html/parse_test.go (+1/-1) html/token.go (+1/-1) log.go (+7/-7) rietveld.go (+5/-5) |
To merge this branch: | bzr merge lp:~wallyworld/goetveld/auth-cookie-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John A Meinel (community) | Approve | ||
Dimiter Naydenov (community) | Approve | ||
Review via email: mp+147585@code.launchpad.net |
Description of the change
Fix auth cookie handling
I came across this issue when my cached credentials expired and I couldn't login again to propose a code review.
It turns out that the authentication with my username/password was succeeding, and the server returned the correct
cookie information, but the cookies were being ignored by the client and not saved to the .goetveld_
file. Playing with curl and reviewing the Go http client source showed that unless a cookie jar was set up when the client
is created, any cookies generated by the server are ignored. And the relevant tests failed also it turns out.
I've made the necessary changes and everything now works. Perhaps this library was developed using an earlier version of Go
where the API was different? Do we need to test if this change works with eariler Go versions? I'm using 1.0.3.
My changes only affected the auth.go file, but when I ran go fmt over the code base it made small changes to a bunch of other files, and these are included also.
Please take a look.