use of io.servicetalk.http.api.HttpSetCookie in project servicetalk by apple.
the class NettyH2HeadersToHttpHeaders method removeSetCookies.
@Override
public boolean removeSetCookies(final CharSequence name, final CharSequence domain, final CharSequence path) {
final int sizeBefore = size();
Iterator<? extends CharSequence> valueItr = nettyHeaders.valueIterator(HttpHeaderNames.SET_COOKIE);
while (valueItr.hasNext()) {
// In the future we could attempt to delay full parsing of the cookie until after the domain/path have
// been matched, but for simplicity just do the parsing ahead of time.
HttpSetCookie setCookie = HeaderUtils.parseSetCookie(valueItr.next(), name, false);
if (setCookie != null && domainMatches(domain, setCookie.domain()) && pathMatches(path, setCookie.path())) {
valueItr.remove();
}
}
return sizeBefore != size();
}
Aggregations