From 484af3d67c6643b2788a2c5296b2d2d5244d7c7b Mon Sep 17 00:00:00 2001 From: Lilli Date: Fri, 12 Feb 2010 15:33:09 -0800 Subject: [PATCH] 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 --- openid/fetchers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openid/fetchers.py b/openid/fetchers.py index f563feaf..944e2157 100644 --- a/openid/fetchers.py +++ b/openid/fetchers.py @@ -249,7 +249,11 @@ def _parseHeaders(self, header_file): 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