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

Changeset 1167

Show
Ignore:
Timestamp:
06/28/06 00:29:13
Author:
fumanchu
Message:

Support for folded response headers in webtest.

Files:

Legend:

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

    r1123 r1167  
    390390             
    391391            outheaders = [] 
     392            key, value = None, None 
    392393            for line in response.msg.headers: 
    393                 key, value = line.split(":", 1) 
    394                 outheaders.append((key.strip(), value.strip())) 
     394                if line: 
     395                    if line[0] in " \t": 
     396                        value += line.strip() 
     397                    else: 
     398                        if key and value: 
     399                            outheaders.append((key, value)) 
     400                        key, value = line.split(":", 1) 
     401                        key = key.strip() 
     402                        value = value.strip() 
     403            if key and value: 
     404                outheaders.append((key, value)) 
    395405             
    396406            outbody = response.read() 

Hosted by WebFaction

Log in as guest/cpguest to create tickets