#NEWLINE# def _AddHostToContinueURL( self , continue_url ) : #NEWLINE# #INDENT# 'Adds the request host to the continue url if no host is specified.\n\n    Args:\n      continue_url: the URL which may or may not have a host specified\n\n    Returns:\n      string\n    ' #NEWLINE# ( protocol , host , path , parameters , query , fragment ) = urlparse . urlparse ( continue_url , 'http' ) #NEWLINE# if host : #NEWLINE# #INDENT# return continue_url #NEWLINE# #UNINDENT# host = os . environ [ 'SERVER_NAME' ] #NEWLINE# if ( os . environ [ 'SERVER_PORT' ] != '80' ) : #NEWLINE# #INDENT# host = ( ( host + ':' ) + os . environ [ 'SERVER_PORT' ] ) #NEWLINE# #UNINDENT# if ( path == '' ) : #NEWLINE# #INDENT# path = '/' #NEWLINE# #UNINDENT# return urlparse . urlunparse ( ( protocol , host , path , path , query , fragment ) )