-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

tags 695050 + patch pending
severity 695050 important
kthxbye

Hi,

I ported the patch from Ubuntu to the Debian package and prepared an NMU 
should the team appreciate that. The following files will be of interest:

Source package: http://shore.naturalnet.de/~nik/python-webob_1.1.1-1.1.dsc
Binary package: http://shore.naturalnet.de/~nik/python-webob_1.1.1-1.1_all.deb

Mehdi, can you please test the package in your test case and report if 
that really fixes the bug for you? If it does, the Python modules team 
will either fix the bug themselves or I will RFS the package.

Attached is the debdiff for this change.

I chose to downgrade the severity because this bug does not affect all use 
cases of python-webob. Please note that important bugs still qualify for 
wheezy freeze exceptions.

Cheers,
Nik

- -- 
* mirabilos is handling my post-1990 smartphone *
<mirabilos> Aaah, it vibrates! Wherefor art thou, daemonic device??

PGP fingerprint: 2086 9A4B E67D 1DCD FFF6  F6C1 59FC 8E1D 6F2A 8001
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQFOBAEBAgA4BQJQvTq9MRpodHRwczovL3d3dy5kb21pbmlrLWdlb3JnZS5kZS9n
cGctcG9saWN5LnR4dC5hc2MACgkQWfyOHW8qgAG3RQf+J2UUm8eaHyp9bbQ94bED
GB8JhPNR7o24Hap2fZAiq5hjSKN/cMz/We3KMB/5e7MThdYeZUOCqTaocb/fUymD
2MISV7/Ql7TGeOdZ5hisLEbzai8LTI00DB3T/iKVuvei3M5FTcEi3VD+4JX2qen/
ggszA3h9vt2VJUDPOObi2P8e8XhB9vjKkuqq3hqNimK2i4a6+cLsrLmvsec/s11d
FgRVirIvdjabeLsOBwfT0Yv5pJTRPG3Sz9v0rc0xRZxngJnDg9dm4fS+fB2d4HCm
rH8rIcuiDZYsSeOoGCyACgbB6izVVnLe8DZeAL9gG0woc/02S3yr098/A8lDCIGT
JA==
=rKmS
-----END PGP SIGNATURE-----
diff -Nru python-webob-1.1.1/debian/changelog python-webob-1.1.1/debian/changelog
--- python-webob-1.1.1/debian/changelog	2011-09-19 19:53:36.000000000 +0200
+++ python-webob-1.1.1/debian/changelog	2012-12-04 00:11:36.000000000 +0100
@@ -1,3 +1,10 @@
+python-webob (1.1.1-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix response header bug reported by Mehdi Abaakouk (Closes: #695050).
+
+ -- Dominik George <n...@naturalnet.de>  Tue, 04 Dec 2012 00:09:48 +0100
+
 python-webob (1.1.1-1) unstable; urgency=low
 
   * New upstream release
diff -Nru python-webob-1.1.1/debian/patches/head_bugfix_lp_920197.patch python-webob-1.1.1/debian/patches/head_bugfix_lp_920197.patch
--- python-webob-1.1.1/debian/patches/head_bugfix_lp_920197.patch	1970-01-01 01:00:00.000000000 +0100
+++ python-webob-1.1.1/debian/patches/head_bugfix_lp_920197.patch	2012-12-04 00:09:11.000000000 +0100
@@ -0,0 +1,71 @@
+--- a/tests/test_exc.py
++++ b/tests/test_exc.py
+@@ -55,6 +55,7 @@
+ from webob.exc import HTTPInsufficientStorage
+ from webob.exc import HTTPExceptionMiddleware
+ from webob import exc
++from webob.exc import status_map
+ 
+ from nose.tools import eq_, ok_, assert_equal, assert_raises
+ 
+@@ -250,6 +251,43 @@
+     exc.newstyle_exceptions = False
+     assert_equal( excep(environ,start_response), [] )
+ 
++def test_HTTPOk_head_of_proxied_head():
++    # first set up a response to a HEAD request
++    HELLO_WORLD = "Hi!\n"
++    CONTENT_TYPE = "application/hello"
++    def head_app(environ, start_response):
++        """An application object that understands HEAD"""
++        status = '200 OK'
++        response_headers = [('Content-Type', CONTENT_TYPE),
++                            ('Content-Length', len(HELLO_WORLD))]
++        start_response(status, response_headers)
++
++        if environ['REQUEST_METHOD'] == 'HEAD':
++            return []
++        else:
++            return [HELLO_WORLD]
++
++    def verify_response(resp, description):
++        assert_equal(resp.content_type, CONTENT_TYPE, description)
++        assert_equal(resp.content_length, len(HELLO_WORLD), description)
++        assert_equal(resp.body, '', description)
++
++    req = Request.blank('/', method='HEAD')
++    resp1 = req.get_response(head_app)
++    verify_response(resp1, "first response")
++
++    # Copy the response like a proxy server would.
++    # Copying an empty body has set content_length
++    # so copy the headers only afterwards.
++    resp2 = status_map[resp1.status_int](request=req)
++    resp2.body = resp1.body
++    resp2.headerlist = resp1.headerlist
++    verify_response(resp2, "copied response")
++
++    # evaluate it again
++    resp3 = req.get_response(resp2)
++    verify_response(resp3, "evaluated copy")
++
+ def test_HTTPMove():
+     def start_response(status, headers, exc_info=None):
+         pass
+--- a/webob/exc.py
++++ b/webob/exc.py
+@@ -314,11 +314,12 @@
+         return resp(environ, start_response)
+ 
+     def __call__(self, environ, start_response):
+-        if self.body or self.empty_body:
++        is_head = environ['REQUEST_METHOD'] == 'HEAD'
++        if self.body or self.empty_body or is_head:
+             app_iter = Response.__call__(self, environ, start_response)
+         else:
+             app_iter = self.generate_response(environ, start_response)
+-        if environ['REQUEST_METHOD'] == 'HEAD':
++        if is_head:
+             app_iter = []
+         return app_iter
+ 
diff -Nru python-webob-1.1.1/debian/patches/series python-webob-1.1.1/debian/patches/series
--- python-webob-1.1.1/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ python-webob-1.1.1/debian/patches/series	2012-12-04 00:07:25.000000000 +0100
@@ -0,0 +1 @@
+head_bugfix_lp_920197.patch

Reply via email to