Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2454: 001_webob_0_9_8_content_length.diff

File 001_webob_0_9_8_content_length.diff, 876 bytes (added by Clicky, 19 months ago)
  • Pylons-0.9.7/pylons/middleware.py

    a b  
    212212             
    213213            newstatus, headers, app_iter, exc_info = call_wsgi_application( 
    214214                    self.app, new_environ, catch_exc_info=True) 
     215            # WebOb 0.9.8+ rejects responses where the value of Content-Length 
     216            # doesn't match the actual length of the content. Since the headers 
     217            # are modified by the 2nd call to call_wsgi_application() but the 
     218            # content is still that of the 1st call, we let WebOb determine the 
     219            # correct length. 
     220            headers = [(hn, hv) for (hn, hv) in headers 
     221                        if hn.lower() != 'content-length'] 
    215222        start_response(status, headers, exc_info) 
    216223        return app_iter 
    217224