Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 2077

Show
Ignore:
Timestamp:
11/08/08 16:18:11
Author:
fumanchu
Message:

Test and fix for #864 (response.stream and HEAD method).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test_conn.py

    r2002 r2077  
    172172                    # Make another request on the same connection, which should error. 
    173173                    self.assertRaises(httplib.NotConnected, self.getPage, "/") 
     174                 
     175                # Try HEAD. See http://www.cherrypy.org/ticket/864. 
     176                self.getPage("/stream", method='HEAD') 
     177                self.assertStatus('200 OK') 
     178                self.assertBody('') 
     179                self.assertNoHeader("Transfer-Encoding") 
    174180        else: 
    175181            self.PROTOCOL = "HTTP/1.0" 
  • trunk/cherrypy/wsgiserver/__init__.py

    r2076 r2077  
    653653                pass 
    654654            else: 
    655                 if self.response_protocol == 'HTTP/1.1': 
     655                if (self.response_protocol == 'HTTP/1.1' 
     656                    and self.environ["REQUEST_METHOD"] != 'HEAD'): 
    656657                    # Use the chunked transfer-coding 
    657658                    self.chunked_write = True 

Hosted by WebFaction

Log in as guest/cpguest to create tickets