Use core MessageSupport methods instead of internal ones
This commit is contained in:
parent
4dc82b40f6
commit
df090e4228
|
@ -29,27 +29,22 @@ package org.apache.hc.client5.http.cache;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TreeSet;
|
|
||||||
|
|
||||||
import org.apache.hc.client5.http.impl.cache.CacheKeyGenerator;
|
import org.apache.hc.client5.http.impl.cache.CacheKeyGenerator;
|
||||||
import org.apache.hc.client5.http.utils.DateUtils;
|
import org.apache.hc.client5.http.utils.DateUtils;
|
||||||
import org.apache.hc.core5.annotation.Contract;
|
import org.apache.hc.core5.annotation.Contract;
|
||||||
import org.apache.hc.core5.annotation.Internal;
|
|
||||||
import org.apache.hc.core5.annotation.ThreadingBehavior;
|
import org.apache.hc.core5.annotation.ThreadingBehavior;
|
||||||
import org.apache.hc.core5.http.Header;
|
import org.apache.hc.core5.http.Header;
|
||||||
import org.apache.hc.core5.http.HeaderElements;
|
|
||||||
import org.apache.hc.core5.http.HttpHeaders;
|
import org.apache.hc.core5.http.HttpHeaders;
|
||||||
import org.apache.hc.core5.http.HttpHost;
|
import org.apache.hc.core5.http.HttpHost;
|
||||||
import org.apache.hc.core5.http.HttpMessage;
|
import org.apache.hc.core5.http.HttpMessage;
|
||||||
import org.apache.hc.core5.http.HttpRequest;
|
import org.apache.hc.core5.http.HttpRequest;
|
||||||
import org.apache.hc.core5.http.HttpResponse;
|
import org.apache.hc.core5.http.HttpResponse;
|
||||||
import org.apache.hc.core5.http.HttpStatus;
|
import org.apache.hc.core5.http.HttpStatus;
|
||||||
import org.apache.hc.core5.http.MessageHeaders;
|
|
||||||
import org.apache.hc.core5.http.message.BasicHeader;
|
import org.apache.hc.core5.http.message.BasicHeader;
|
||||||
import org.apache.hc.core5.http.message.HeaderGroup;
|
import org.apache.hc.core5.http.message.HeaderGroup;
|
||||||
import org.apache.hc.core5.http.message.MessageSupport;
|
import org.apache.hc.core5.http.message.MessageSupport;
|
||||||
|
@ -65,39 +60,6 @@ public class HttpCacheEntryFactory {
|
||||||
|
|
||||||
public static final HttpCacheEntryFactory INSTANCE = new HttpCacheEntryFactory();
|
public static final HttpCacheEntryFactory INSTANCE = new HttpCacheEntryFactory();
|
||||||
|
|
||||||
private final static Set<String> HOP_BY_HOP;
|
|
||||||
|
|
||||||
static {
|
|
||||||
final TreeSet<String> set = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
|
|
||||||
set.add(HttpHeaders.CONNECTION);
|
|
||||||
set.add(HttpHeaders.CONTENT_LENGTH);
|
|
||||||
set.add(HttpHeaders.TRANSFER_ENCODING);
|
|
||||||
set.add(HttpHeaders.HOST);
|
|
||||||
set.add(HttpHeaders.KEEP_ALIVE);
|
|
||||||
set.add(HttpHeaders.TE);
|
|
||||||
set.add(HttpHeaders.UPGRADE);
|
|
||||||
set.add(HttpHeaders.PROXY_AUTHORIZATION);
|
|
||||||
set.add("Proxy-Authentication-Info");
|
|
||||||
set.add(HttpHeaders.PROXY_AUTHENTICATE);
|
|
||||||
HOP_BY_HOP = Collections.unmodifiableSet(set);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Internal
|
|
||||||
public static boolean isHopByHop(final String headerName) {
|
|
||||||
if (headerName == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return HOP_BY_HOP.contains(headerName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Internal
|
|
||||||
public static boolean isHopByHop(final Header header) {
|
|
||||||
if (header == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return isHopByHop(header.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static HeaderGroup headers(final Iterator<Header> it) {
|
private static HeaderGroup headers(final Iterator<Header> it) {
|
||||||
final HeaderGroup headerGroup = new HeaderGroup();
|
final HeaderGroup headerGroup = new HeaderGroup();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
|
@ -115,7 +77,7 @@ public class HttpCacheEntryFactory {
|
||||||
headerGroup.addHeader(entryHeader);
|
headerGroup.addHeader(entryHeader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Set<String> responseHopByHop = HttpCacheEntryFactory.hopByHopConnectionSpecific(response);
|
final Set<String> responseHopByHop = MessageSupport.hopByHopConnectionSpecific(response);
|
||||||
for (final Iterator<Header> it = response.headerIterator(); it.hasNext(); ) {
|
for (final Iterator<Header> it = response.headerIterator(); it.hasNext(); ) {
|
||||||
final Header responseHeader = it.next();
|
final Header responseHeader = it.next();
|
||||||
final String headerName = responseHeader.getName();
|
final String headerName = responseHeader.getName();
|
||||||
|
@ -129,24 +91,8 @@ public class HttpCacheEntryFactory {
|
||||||
/**
|
/**
|
||||||
* This method should be provided by the core
|
* This method should be provided by the core
|
||||||
*/
|
*/
|
||||||
static Set<String> hopByHopConnectionSpecific(final MessageHeaders headers) {
|
|
||||||
final Header connectionHeader = headers.getFirstHeader(HttpHeaders.CONNECTION);
|
|
||||||
final String connDirective = connectionHeader != null ? connectionHeader.getValue() : null;
|
|
||||||
// Disregard most common 'Close' and 'Keep-Alive' tokens
|
|
||||||
if (connDirective != null &&
|
|
||||||
!connDirective.equalsIgnoreCase(HeaderElements.CLOSE) &&
|
|
||||||
!connDirective.equalsIgnoreCase(HeaderElements.KEEP_ALIVE)) {
|
|
||||||
final TreeSet<String> result = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
|
|
||||||
result.addAll(HOP_BY_HOP);
|
|
||||||
result.addAll(MessageSupport.parseTokens(connectionHeader));
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return HOP_BY_HOP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static HeaderGroup filterHopByHopHeaders(final HttpMessage message) {
|
static HeaderGroup filterHopByHopHeaders(final HttpMessage message) {
|
||||||
final Set<String> hopByHop = hopByHopConnectionSpecific(message);
|
final Set<String> hopByHop = MessageSupport.hopByHopConnectionSpecific(message);
|
||||||
final HeaderGroup headerGroup = new HeaderGroup();
|
final HeaderGroup headerGroup = new HeaderGroup();
|
||||||
for (final Iterator<Header> it = message.headerIterator(); it.hasNext(); ) {
|
for (final Iterator<Header> it = message.headerIterator(); it.hasNext(); ) {
|
||||||
final Header header = it.next();
|
final Header header = it.next();
|
||||||
|
|
|
@ -56,6 +56,7 @@ import org.apache.hc.core5.http.URIScheme;
|
||||||
import org.apache.hc.core5.http.message.BasicHeaderElementIterator;
|
import org.apache.hc.core5.http.message.BasicHeaderElementIterator;
|
||||||
import org.apache.hc.core5.http.message.BasicHeaderValueFormatter;
|
import org.apache.hc.core5.http.message.BasicHeaderValueFormatter;
|
||||||
import org.apache.hc.core5.http.message.BasicNameValuePair;
|
import org.apache.hc.core5.http.message.BasicNameValuePair;
|
||||||
|
import org.apache.hc.core5.http.message.MessageSupport;
|
||||||
import org.apache.hc.core5.net.PercentCodec;
|
import org.apache.hc.core5.net.PercentCodec;
|
||||||
import org.apache.hc.core5.net.URIAuthority;
|
import org.apache.hc.core5.net.URIAuthority;
|
||||||
import org.apache.hc.core5.net.URIBuilder;
|
import org.apache.hc.core5.net.URIBuilder;
|
||||||
|
@ -207,7 +208,7 @@ public class CacheKeyGenerator implements Resolver<URI, String> {
|
||||||
final List<String> names = new ArrayList<>();
|
final List<String> names = new ArrayList<>();
|
||||||
for (final Iterator<Header> it = message.headerIterator(HttpHeaders.VARY); it.hasNext(); ) {
|
for (final Iterator<Header> it = message.headerIterator(HttpHeaders.VARY); it.hasNext(); ) {
|
||||||
final Header header = it.next();
|
final Header header = it.next();
|
||||||
CacheSupport.parseTokens(header, names::add);
|
MessageSupport.parseTokens(header, names::add);
|
||||||
}
|
}
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,21 +27,14 @@
|
||||||
package org.apache.hc.client5.http.impl.cache;
|
package org.apache.hc.client5.http.impl.cache;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.BitSet;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
import org.apache.hc.client5.http.utils.URIUtils;
|
import org.apache.hc.client5.http.utils.URIUtils;
|
||||||
import org.apache.hc.core5.annotation.Internal;
|
import org.apache.hc.core5.annotation.Internal;
|
||||||
import org.apache.hc.core5.http.FormattedHeader;
|
|
||||||
import org.apache.hc.core5.http.Header;
|
import org.apache.hc.core5.http.Header;
|
||||||
import org.apache.hc.core5.http.MessageHeaders;
|
import org.apache.hc.core5.http.MessageHeaders;
|
||||||
import org.apache.hc.core5.http.message.ParserCursor;
|
|
||||||
import org.apache.hc.core5.util.Args;
|
|
||||||
import org.apache.hc.core5.util.CharArrayBuffer;
|
|
||||||
import org.apache.hc.core5.util.TextUtils;
|
import org.apache.hc.core5.util.TextUtils;
|
||||||
import org.apache.hc.core5.util.TimeValue;
|
import org.apache.hc.core5.util.TimeValue;
|
||||||
import org.apache.hc.core5.util.Tokenizer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP cache support utilities.
|
* HTTP cache support utilities.
|
||||||
|
@ -51,39 +44,6 @@ import org.apache.hc.core5.util.Tokenizer;
|
||||||
@Internal
|
@Internal
|
||||||
public final class CacheSupport {
|
public final class CacheSupport {
|
||||||
|
|
||||||
private static final BitSet COMMA = Tokenizer.INIT_BITSET(',');
|
|
||||||
|
|
||||||
// This method should be provided by MessageSupport from core
|
|
||||||
public static void parseTokens(final CharSequence src, final ParserCursor cursor, final Consumer<String> consumer) {
|
|
||||||
Args.notNull(src, "Source");
|
|
||||||
Args.notNull(cursor, "Cursor");
|
|
||||||
while (!cursor.atEnd()) {
|
|
||||||
final int pos = cursor.getPos();
|
|
||||||
if (src.charAt(pos) == ',') {
|
|
||||||
cursor.updatePos(pos + 1);
|
|
||||||
}
|
|
||||||
final String token = Tokenizer.INSTANCE.parseToken(src, cursor, COMMA);
|
|
||||||
if (consumer != null) {
|
|
||||||
consumer.accept(token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method should be provided by MessageSupport from core
|
|
||||||
public static void parseTokens(final Header header, final Consumer<String> consumer) {
|
|
||||||
Args.notNull(header, "Header");
|
|
||||||
if (header instanceof FormattedHeader) {
|
|
||||||
final CharArrayBuffer buf = ((FormattedHeader) header).getBuffer();
|
|
||||||
final ParserCursor cursor = new ParserCursor(0, buf.length());
|
|
||||||
cursor.updatePos(((FormattedHeader) header).getValuePos());
|
|
||||||
parseTokens(buf, cursor, consumer);
|
|
||||||
} else {
|
|
||||||
final String value = header.getValue();
|
|
||||||
final ParserCursor cursor = new ParserCursor(0, value.length());
|
|
||||||
parseTokens(value, cursor, consumer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static URI getLocationURI(final URI requestUri, final MessageHeaders response, final String headerName) {
|
public static URI getLocationURI(final URI requestUri, final MessageHeaders response, final String headerName) {
|
||||||
final Header h = response.getFirstHeader(headerName);
|
final Header h = response.getFirstHeader(headerName);
|
||||||
if (h == null) {
|
if (h == null) {
|
||||||
|
|
|
@ -33,6 +33,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||||
import org.apache.hc.client5.http.cache.HttpCacheEntry;
|
import org.apache.hc.client5.http.cache.HttpCacheEntry;
|
||||||
import org.apache.hc.core5.http.Header;
|
import org.apache.hc.core5.http.Header;
|
||||||
import org.apache.hc.core5.http.HttpHeaders;
|
import org.apache.hc.core5.http.HttpHeaders;
|
||||||
|
import org.apache.hc.core5.http.message.MessageSupport;
|
||||||
import org.apache.hc.core5.util.TimeValue;
|
import org.apache.hc.core5.util.TimeValue;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -177,7 +178,7 @@ class CacheValidityPolicy {
|
||||||
final Header age = entry.getFirstHeader(HttpHeaders.AGE);
|
final Header age = entry.getFirstHeader(HttpHeaders.AGE);
|
||||||
if (age != null) {
|
if (age != null) {
|
||||||
final AtomicReference<String> firstToken = new AtomicReference<>();
|
final AtomicReference<String> firstToken = new AtomicReference<>();
|
||||||
CacheSupport.parseTokens(age, token -> firstToken.compareAndSet(null, token));
|
MessageSupport.parseTokens(age, token -> firstToken.compareAndSet(null, token));
|
||||||
final long delta = CacheSupport.deltaSeconds(firstToken.get());
|
final long delta = CacheSupport.deltaSeconds(firstToken.get());
|
||||||
if (delta == -1 && LOG.isDebugEnabled()) {
|
if (delta == -1 && LOG.isDebugEnabled()) {
|
||||||
LOG.debug("Malformed Age value: {}", age);
|
LOG.debug("Malformed Age value: {}", age);
|
||||||
|
|
|
@ -221,7 +221,7 @@ class CachedResponseSuitabilityChecker {
|
||||||
final Set<String> headerNames = new HashSet<>();
|
final Set<String> headerNames = new HashSet<>();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
final Header header = it.next();
|
final Header header = it.next();
|
||||||
CacheSupport.parseTokens(header, e -> {
|
MessageSupport.parseTokens(header, e -> {
|
||||||
headerNames.add(e.toLowerCase(Locale.ROOT));
|
headerNames.add(e.toLowerCase(Locale.ROOT));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.apache.hc.core5.http.HttpStatus;
|
||||||
import org.apache.hc.core5.http.HttpVersion;
|
import org.apache.hc.core5.http.HttpVersion;
|
||||||
import org.apache.hc.core5.http.Method;
|
import org.apache.hc.core5.http.Method;
|
||||||
import org.apache.hc.core5.http.ProtocolVersion;
|
import org.apache.hc.core5.http.ProtocolVersion;
|
||||||
import org.apache.hc.core5.http.message.BasicTokenIterator;
|
import org.apache.hc.core5.http.message.MessageSupport;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ class ResponseCachingPolicy {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Treat responses with `Vary: *` as essentially non-cacheable.
|
// Treat responses with `Vary: *` as essentially non-cacheable.
|
||||||
final Iterator<String> it = new BasicTokenIterator(response.headerIterator(HttpHeaders.VARY));
|
final Iterator<String> it = MessageSupport.iterateTokens(response, HttpHeaders.VARY);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
final String token = it.next();
|
final String token = it.next();
|
||||||
if ("*".equals(token)) {
|
if ("*".equals(token)) {
|
||||||
|
@ -303,7 +303,7 @@ class ResponseCachingPolicy {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean from1_0Origin(final HttpResponse response) {
|
private boolean from1_0Origin(final HttpResponse response) {
|
||||||
final Iterator<String> it = new BasicTokenIterator(response.headerIterator(HttpHeaders.VIA));
|
final Iterator<String> it = MessageSupport.iterateTokens(response, HttpHeaders.VIA);
|
||||||
if (it.hasNext()) {
|
if (it.hasNext()) {
|
||||||
final String token = it.next();
|
final String token = it.next();
|
||||||
return token.startsWith("1.0 ") || token.startsWith("HTTP/1.0 ");
|
return token.startsWith("1.0 ") || token.startsWith("HTTP/1.0 ");
|
||||||
|
|
|
@ -47,7 +47,6 @@ import org.apache.hc.core5.http.message.BasicHeader;
|
||||||
import org.apache.hc.core5.http.message.BasicHttpRequest;
|
import org.apache.hc.core5.http.message.BasicHttpRequest;
|
||||||
import org.apache.hc.core5.http.message.BasicHttpResponse;
|
import org.apache.hc.core5.http.message.BasicHttpResponse;
|
||||||
import org.apache.hc.core5.http.message.HeaderGroup;
|
import org.apache.hc.core5.http.message.HeaderGroup;
|
||||||
import org.apache.hc.core5.http.support.BasicResponseBuilder;
|
|
||||||
import org.hamcrest.MatcherAssert;
|
import org.hamcrest.MatcherAssert;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -87,32 +86,6 @@ public class TestHttpCacheEntryFactory {
|
||||||
impl = new HttpCacheEntryFactory();
|
impl = new HttpCacheEntryFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testHopByHopHeaders() {
|
|
||||||
Assertions.assertTrue(HttpCacheEntryFactory.isHopByHop("Connection"));
|
|
||||||
Assertions.assertTrue(HttpCacheEntryFactory.isHopByHop("connection"));
|
|
||||||
Assertions.assertTrue(HttpCacheEntryFactory.isHopByHop("coNNection"));
|
|
||||||
Assertions.assertFalse(HttpCacheEntryFactory.isHopByHop("Content-Type"));
|
|
||||||
Assertions.assertFalse(HttpCacheEntryFactory.isHopByHop("huh"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testHopByHopHeadersConnectionSpecific() {
|
|
||||||
final HttpResponse response = BasicResponseBuilder.create(HttpStatus.SC_OK)
|
|
||||||
.addHeader(HttpHeaders.CONNECTION, "blah, blah, this, that")
|
|
||||||
.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.TEXT_PLAIN.toString())
|
|
||||||
.build();
|
|
||||||
final Set<String> hopByHopConnectionSpecific = HttpCacheEntryFactory.hopByHopConnectionSpecific(response);
|
|
||||||
Assertions.assertTrue(hopByHopConnectionSpecific.contains("Connection"));
|
|
||||||
Assertions.assertTrue(hopByHopConnectionSpecific.contains("connection"));
|
|
||||||
Assertions.assertTrue(hopByHopConnectionSpecific.contains("coNNection"));
|
|
||||||
Assertions.assertFalse(hopByHopConnectionSpecific.contains("Content-Type"));
|
|
||||||
Assertions.assertTrue(hopByHopConnectionSpecific.contains("blah"));
|
|
||||||
Assertions.assertTrue(hopByHopConnectionSpecific.contains("Blah"));
|
|
||||||
Assertions.assertTrue(hopByHopConnectionSpecific.contains("This"));
|
|
||||||
Assertions.assertTrue(hopByHopConnectionSpecific.contains("That"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFilterHopByHopAndConnectionSpecificHeaders() {
|
public void testFilterHopByHopAndConnectionSpecificHeaders() {
|
||||||
response.setHeaders(
|
response.setHeaders(
|
||||||
|
|
|
@ -37,7 +37,6 @@ import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import org.apache.hc.client5.http.cache.HttpCacheEntry;
|
import org.apache.hc.client5.http.cache.HttpCacheEntry;
|
||||||
import org.apache.hc.client5.http.cache.HttpCacheEntryFactory;
|
|
||||||
import org.apache.hc.client5.http.cache.Resource;
|
import org.apache.hc.client5.http.cache.Resource;
|
||||||
import org.apache.hc.client5.http.utils.DateUtils;
|
import org.apache.hc.client5.http.utils.DateUtils;
|
||||||
import org.apache.hc.core5.concurrent.FutureCallback;
|
import org.apache.hc.core5.concurrent.FutureCallback;
|
||||||
|
@ -57,6 +56,7 @@ import org.apache.hc.core5.http.message.BasicClassicHttpRequest;
|
||||||
import org.apache.hc.core5.http.message.BasicClassicHttpResponse;
|
import org.apache.hc.core5.http.message.BasicClassicHttpResponse;
|
||||||
import org.apache.hc.core5.http.message.BasicHeader;
|
import org.apache.hc.core5.http.message.BasicHeader;
|
||||||
import org.apache.hc.core5.http.message.HeaderGroup;
|
import org.apache.hc.core5.http.message.HeaderGroup;
|
||||||
|
import org.apache.hc.core5.http.message.MessageSupport;
|
||||||
import org.apache.hc.core5.util.ByteArrayBuffer;
|
import org.apache.hc.core5.util.ByteArrayBuffer;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ public class HttpTestUtils {
|
||||||
*/
|
*/
|
||||||
public static boolean isEndToEndHeaderSubset(final HttpMessage r1, final HttpMessage r2) {
|
public static boolean isEndToEndHeaderSubset(final HttpMessage r1, final HttpMessage r2) {
|
||||||
for (final Header h : r1.getHeaders()) {
|
for (final Header h : r1.getHeaders()) {
|
||||||
if (!HttpCacheEntryFactory.isHopByHop(h)) {
|
if (!MessageSupport.isHopByHop(h.getName())) {
|
||||||
final String r1val = getCanonicalHeaderValue(r1, h.getName());
|
final String r1val = getCanonicalHeaderValue(r1, h.getName());
|
||||||
final String r2val = getCanonicalHeaderValue(r2, h.getName());
|
final String r2val = getCanonicalHeaderValue(r2, h.getName());
|
||||||
if (!Objects.equals(r1val, r2val)) {
|
if (!Objects.equals(r1val, r2val)) {
|
||||||
|
|
Loading…
Reference in New Issue