def apply_storlet(self, resp):
        outmd, app_iter = self._call_gateway(resp)

        new_headers = resp.headers.copy()

        if 'Content-Length' in new_headers:
            new_headers.pop('Content-Length')
        if 'Transfer-Encoding' in new_headers:
            new_headers.pop('Transfer-Encoding')

        # Range response(206) should be replaced by 200
        if 'Content-Range' in resp.headers:
            new_headers['Storlet-Input-Range'] = resp.headers['Content-Range']
            new_headers.pop('Content-Range')

        return Response(headers=new_headers, app_iter=app_iter,
                        reuqest=self.request)
Apply storlet on response
dataset/ETHPy150Open openstack/storlets/Engine/swift/storlet_middleware/storlet_handler.py/BaseStorletHandler.apply_storlet