diff options
author | Lilli <lilli@janrain.com> | 2010-02-12 15:33:09 -0800 |
---|---|---|
committer | Lilli <lilli@janrain.com> | 2010-02-12 15:33:09 -0800 |
commit | 484af3d67c6643b2788a2c5296b2d2d5244d7c7b (patch) | |
tree | fe6760f489c617a8ef59cb132f415e190d3acf9b /openid/fetchers.py | |
parent | ab353362606bc100209918847bd514b5b5d84774 (diff) | |
download | openid-484af3d67c6643b2788a2c5296b2d2d5244d7c7b.tar.gz |
Added the following patch from the dev@openidenabled.com mailing list:
http://lists.openidenabled.com/pipermail/dev/attachments/20090401/b0bd173c/attachment.bin
Original Message:
seth at lindenlab.com
Wed Apr 1 16:29:08 PDT 2009
darcs patch: 100-continue-in-parseHeaders
"In my openid testbed, if:
(1) my RP and OP establish a session
(2) the OP's session database is deleted
(3) the RP tries to validate an identity
(4) the OP's response includes invalidate_handle
then the RP ends up POSTing to the OP. During this interaction, curl
sets the Expect: 100-Continue header, and apache2 reacts to it. Then,
CurlHTTPFetcher._parseHeaders gets confused -- it strips off the first
line (the HTTP/1.1 100 Continue line), then sees a blank line, and
assumes there are no headers. One way to fix this is to add
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
RequestHeader unset Expect early
to the apache2 config on the OP, but this patch also worked."
This patch was in the form of a Darcs patch, not a normal patch. So solve this, I applied it to the Darcs repository found on openidenabled, then created a new diff file between the original Darcs repo and the new one (with the patch applied) so that I could apply it to this git repo.
All hunks succeeded
Diffstat (limited to 'openid/fetchers.py')
-rw-r--r-- | openid/fetchers.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/openid/fetchers.py b/openid/fetchers.py index f563fea..944e215 100644 --- a/openid/fetchers.py +++ b/openid/fetchers.py @@ -249,7 +249,11 @@ class CurlHTTPFetcher(HTTPFetcher): header_file.seek(0) # Remove the status line from the beginning of the input - unused_http_status_line = header_file.readline() + unused_http_status_line = header_file.readline().lower () + if unused_http_status_line.startswith('http/1.1 100 '): + unused_http_status_line = header_file.readline() + unused_http_status_line = header_file.readline() + lines = [line.strip() for line in header_file] # and the blank line from the end |