def _abs_headerlist(self, environ): """Returns a headerlist, with the Location header possibly made absolute given the request environ. """ headerlist = list(self.headerlist) for i, (name, value) in enumerate(headerlist): if name.lower() == 'location': if SCHEME_RE.search(value): break new_location = urlparse.urljoin(_request_uri(environ), value) headerlist[i] = (name, new_location) break return headerlist
def _abs_headerlist(self, environ): """Returns a headerlist, with the Location header possibly made absolute given the request environ. """ headerlist = self.headerlist for name, value in headerlist: if name.lower() == 'location': if SCHEME_RE.search(value): break new_location = urlparse.urljoin( _request_uri(environ), value) headerlist = list(headerlist) idx = headerlist.index((name, value)) headerlist[idx] = (name, new_location) break return headerlist