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

Changeset 1839

Show
Ignore:
Timestamp:
01/12/08 18:00:22
Author:
fumanchu
Message:

Fixed some problems with redirect after staticdir.

Files:

Legend:

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

    r1832 r1839  
    113113                   }[status] 
    114114            response.body = "<br />\n".join([msg % (u, u) for u in self.urls]) 
     115            # Previous code may have set C-L, so we have to reset it 
     116            # (allow finalize to set it). 
     117            response.headers.pop('Content-Length', None) 
    115118        elif status == 304: 
    116119            # Not Modified. 
     
    129132            # "The 304 response MUST NOT contain a message-body." 
    130133            response.body = None 
     134            # Previous code may have set C-L, so we have to reset it. 
     135            response.headers.pop('Content-Length', None) 
    131136        elif status == 305: 
    132137            # Use Proxy. 
     
    134139            response.headers['Location'] = self.urls[0] 
    135140            response.body = None 
     141            # Previous code may have set C-L, so we have to reset it. 
     142            response.headers.pop('Content-Length', None) 
    136143        else: 
    137144            raise ValueError("The %s status code is unknown." % status) 
  • trunk/cherrypy/test/test_static.py

    r1668 r1839  
    111111        self.getPage("/docroot") 
    112112        self.assertStatus((302, 303)) 
     113        self.assertHeader('Location', '%s/docroot/' % self.base()) 
     114        self.assertBody("This resource can be found at <a href='%s/docroot/'>" 
     115                        "%s/docroot/</a>." % (self.base(), self.base())) 
    113116         
    114117        # Check that we get an error if no .file or .dir 

Hosted by WebFaction

Log in as guest/cpguest to create tickets