if return value of the self.is_secure is false and server port is not equal to string '80', join host and server_port into a string, separated with ':', substitute the result for host.
host = '%s:%s' % ( host , server_port )