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

Changeset 1572

Show
Ignore:
Timestamp:
12/28/06 14:09:37
Author:
fumanchu
Message:

2.x backport of [1538] and [1549] (Fix for leading CRLF in request).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/_cpwsgiserver.py

    r1571 r1572  
    6868            self.ready = False 
    6969            return 
     70         
     71        if request_line == "\r\n": 
     72            # RFC 2616 sec 4.1: "...if the server is reading the protocol 
     73            # stream at the beginning of a message and receives a CRLF 
     74            # first, it should ignore the CRLF." 
     75            # But only ignore one leading line! else we enable a DoS. 
     76            request_line = self.rfile.readline() 
     77            if not request_line: 
     78                self.ready = False 
     79                return 
    7080         
    7181        method, path, req_protocol = request_line.strip().split(" ", 2) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets