package com.usthe.collector.common.http;

import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin;
import org.apache.http.impl.cookie.DefaultCookieSpec;

/**
 * 在request请求时忽略携带cookie,返回response时更新cookie的策略
 * @author tomsun28
 * @date 2021/8/30 22:37
 */
public class IgnoreReqCookieSpec extends DefaultCookieSpec {

    public static final String COOKIE_SPEC_NAME = "IGNORE_REQUEST_COOKIE";

    public IgnoreReqCookieSpec() {
        super();
    }

    @Override
    public boolean match(Cookie cookie, CookieOrigin origin) {
        return false;
    }

    @Override
    public String toString() {
        return COOKIE_SPEC_NAME;
    }
}
