From c3d99b130ce29fe8b28124fe634c864ca164c48d Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Sun, 24 Dec 2023 17:49:44 +0100 Subject: [PATCH] Do not set the default HTTP version of cache response messages --- .../hc/client5/http/impl/cache/CachedHttpResponseGenerator.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedHttpResponseGenerator.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedHttpResponseGenerator.java index da2ed762c..9002809be 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedHttpResponseGenerator.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedHttpResponseGenerator.java @@ -39,7 +39,6 @@ import org.apache.hc.core5.http.HttpHeaders; import org.apache.hc.core5.http.HttpRequest; import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.HttpStatus; -import org.apache.hc.core5.http.HttpVersion; import org.apache.hc.core5.http.Method; import org.apache.hc.core5.http.message.BasicHeader; import org.apache.hc.core5.util.TimeValue; @@ -66,7 +65,6 @@ class CachedHttpResponseGenerator { SimpleHttpResponse generateResponse(final HttpRequest request, final HttpCacheEntry entry) throws ResourceIOException { final Instant now = Instant.now(); final SimpleHttpResponse response = new SimpleHttpResponse(entry.getStatus()); - response.setVersion(HttpVersion.DEFAULT); response.setHeaders(entry.getHeaders());