#NEWLINE# def process_headers( self ) : #NEWLINE# #INDENT# 'Parse HTTP header data into Python structures. (Core)' #NEWLINE# headers = self . headers #NEWLINE# for ( name , value ) in self . header_list : #NEWLINE# #INDENT# name = name . title ( ) #NEWLINE# value = value . strip ( ) #NEWLINE# if ( '=?' in value ) : #NEWLINE# #INDENT# dict . __setitem__ ( headers , name , httputil . decode_TEXT ( value ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dict . __setitem__ ( headers , name , value ) #NEWLINE# #UNINDENT# if ( name == 'Cookie' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . cookie . load ( value ) #NEWLINE# #UNINDENT# except CookieError : #NEWLINE# #INDENT# msg = ( 'Illegal cookie name %s' % value . split ( '=' ) [ 0 ] ) #NEWLINE# raise cherrypy . HTTPError ( 400 , msg ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not dict . __contains__ ( headers , 'Host' ) ) : #NEWLINE# #INDENT# if ( self . protocol >= ( 1 , 1 ) ) : #NEWLINE# #INDENT# msg = "HTTP/1.1 requires a 'Host' request header." #NEWLINE# raise cherrypy . HTTPError ( 400 , msg ) #NEWLINE# #UNINDENT# #UNINDENT# host = dict . get ( headers , 'Host' ) #NEWLINE# if ( not host ) : #NEWLINE# #INDENT# host = ( self . local . name or self . local . ip ) #NEWLINE# #UNINDENT# self . base = ( '%s://%s' % ( self . scheme , host ) )