#NEWLINE# def httpHeader( whole , key ) : #NEWLINE# #INDENT# key = key . lower ( ) #NEWLINE# headers = whole . split ( '\r\n\r\n' , 1 ) [ 0 ] #NEWLINE# for header in headers . split ( '\r\n' ) : #NEWLINE# #INDENT# if header . lower ( ) . startswith ( key ) : #NEWLINE# #INDENT# return header . split ( ':' , 1 ) [ 1 ] . strip ( ) #NEWLINE# #UNINDENT# #UNINDENT# return None