def _clean_outgoing_headers(self, headers):
        headers = HeaderKeyDict(headers)
        for h in headers.keys():
            if h in self.outgoing_allow_headers:
                continue
            for p in self.outgoing_allow_headers_startswith:
                if h.startswith(p):
                    break
            else:
                if h in self.outgoing_remove_headers:
                    del headers[h]
                    continue
                for p in self.outgoing_remove_headers_startswith:
                    if h.startswith(p):
                        del headers[h]
                        break
        return headers.items()
Removes any headers as per the middleware configuration for
dataset/ETHPy150Open openstack/swift/swift/common/middleware/tempurl.py/TempURL._clean_outgoing_headers