'Returns a headerlist, with the Location header possibly
made absolute given the request environ.'

def _abs_headerlist(self, 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
