@property
    def uri(self):
        if self._cached_uri is None:
            env = self.env
            protocol = env['wsgi.url_scheme']

            # NOTE(kgriffs): According to PEP-3333 we should first
            # try to use the Host header if present.
            #
            # PERF(kgriffs): try..except is faster than .get
            try:
                host = env['HTTP_HOST']
            except __HOLE__:
                host = env['SERVER_NAME']
                port = env['SERVER_PORT']

                if protocol == 'https':
                    if port != '443':
                        host += ':' + port
                else:
                    if port != '80':
                        host += ':' + port

            # PERF: For small numbers of items, '+' is faster
            # than ''.join(...). Concatenation is also generally
            # faster than formatting.
            value = (protocol + '://' +
                     host +
                     self.app +
                     self.path)

            if self.query_string:
                value = value + '?' + self.query_string

            self._cached_uri = value

        return self._cached_uri
dataset/ETHPy150Open falconry/falcon/falcon/request.py/Request.uri