def METHOD_NAME(res, **kwargs):
    if res.headers.get("x-waf-redirect") == "1":
        if not res.headers.get("X-WAF-Backend-Status"):
            log.debug("Getting WAF cookie")
            cookie = res.cookies.get(self.HASH_COOKIE)
            key = md5(cookie.encode("utf-8")).hexdigest()
            res.headers["Location"] = update_qsd(res.headers["Location"], qsd={"key": key})
            return res
        elif res.headers.get("X-WAF-Backend-Status") == "challenge_success":
            self.session.http.cookies.update(res.cookies)
            return res