160 Commits

Author SHA1 Message Date
Oleg Kalnichevski
19ab1111c7 More consistent handling of OperationTimeoutException in MemcachedHttpCacheStorage 2023-09-29 15:24:37 +02:00
Oleg Kalnichevski
83c6079e65 NTLM scheme deprecated and disabled by default 2023-08-12 17:14:53 +02:00
Gary Gregory
09ae5f212a Mostly missing Javadoc in org.apache.hc.client5.http.entity and minor
clean ups
2023-07-02 16:31:07 -04:00
Oleg Kalnichevski
3e38a5e5ec HTTPCLIENT-2271: Do not optimize the path component of the resolved URI by default. 2023-04-27 17:13:53 +02:00
Michael Lee
ec5b1f1d60 Hygiene - remove unused private fields 2023-03-13 15:43:31 +01:00
MartinWitt
f198fc0e62 Make inner classes static (#405) 2023-03-13 15:43:24 +01:00
Gary Gregory
290ec22022 Fix compiler warnings in tests
Use try-with-resources, also avoids possible leaks on test failures
2022-11-14 22:13:14 +01:00
Gary Gregory
230a2caf67 Replace deprecated use of LangUtils#equals() with Objects.equals() 2022-11-14 09:57:05 -05:00
Gary Gregory
dca9108352 Use try-with-resources 2022-07-06 10:56:04 -04:00
Gary Gregory
1cd12fc1dc Cleaning up:
- Super interface already implements FutureCallback
- No need to override methods to only call super
- Add missing Javadoc tag
- Access static field directly
2022-07-06 10:13:23 -04:00
jkmcl
15951d8094 Use HTTP header name constants
Use HTTP header name constants instead of string literals.
2022-06-20 19:25:00 +02:00
j3graham
26dcc6f914 HTTPCLIENT-2218: Use Java 8 Base64 utility (#370) 2022-06-01 23:04:29 +02:00
Oleg Kalnichevski
b9a6b5ed89 HTTPCLIENT-2202: MemcachedHttpCacheStorage to support MemcachedClientIF interface 2022-02-10 20:33:59 +01:00
Arturo Bernal
4c464b2432 Avoid redundant validation of '\"'. Its check it before. 2021-12-12 20:50:25 +01:00
Arturo Bernal
c091c05b72 Expose method to check the cache is still active. 2021-12-11 12:08:17 +01:00
Arturo Bernal
d323e0d684 HTTPCLIENT-2189 - Cookie and Cache APIs to use Java time primitives 2021-11-29 14:21:01 +01:00
Arturo Bernal
0a42d173ef HTTPCLIENT-2186 - Migrate Test to Unit 5. 2021-11-21 19:44:13 +01:00
Arturo Bernal
4d0caa4f42 Fix typo method and class. Deprecate the old ones. 2021-11-12 22:16:52 +01:00
Oleg Kalnichevski
3dd37952bc Use Java 8 Time APIs for date / time operations in the HTTP cache tests 2021-11-09 22:50:00 +01:00
Oleg Kalnichevski
dfc2086d24 Replaced SimpleDateFormat and Calendar with Java 8 Time APIs; removed thread-local from DateUtils 2021-10-24 16:50:07 +02:00
Arturo Bernal
277c7228c3 Change loop that don't loop for "if" conditions. 2021-10-23 18:10:15 +02:00
Gary Gregory
b6ae693fe5 Don't initialize AtomicReference to its default value. 2021-10-13 10:36:49 +02:00
Oleg Kalnichevski
5390aef223 Always bind the exchange ID to the execution context 2021-09-29 18:01:46 +02:00
Oleg Kalnichevski
aff1d2024c Better exception asserts in unit tests 2021-06-19 21:10:43 +02:00
Oleg Kalnichevski
760795b6df HTTPCLIENT-1244: Replaced EasyMock with Mockito in the HTTP cache unit tests 2021-06-19 16:49:12 +02:00
Arturo Bernal
d77112f608 Replace assert calls by simpler but equivalent calls. 2021-06-19 16:47:44 +02:00
Arturo Bernal
fde3fca687 Simplify conditions and avoid extra checks.
Inline return variables.
2021-06-19 16:47:41 +02:00
Oleg Kalnichevski
0805cfe582 Updated test cases with exception asserts 2021-05-24 18:53:58 +02:00
Oleg Kalnichevski
82432f50d9 Removed references to deprecated Assert#assertThat 2021-05-24 16:58:33 +02:00
Oleg Kalnichevski
8580d7fddf Redundant type declarations 2021-05-24 14:43:18 +02:00
Oleg Kalnichevski
bb04d078ad Java 1.8 upgrade 2021-05-11 21:34:49 +02:00
Oleg Kalnichevski
b151df7e8c HTTPCLIENT-2157: response object generated by the classic caching backend is missing the original content encoding 2021-05-01 17:27:12 +02:00
Oleg Kalnichevski
13137eb6c7 Async clients to support scheduled (delayed) re-execution of requests 2021-04-27 12:57:15 +02:00
Arturo Bernal
e0c049060b Fix javadoc 2021-03-28 12:36:14 +02:00
Arturo Bernal
879a063b57 Reuse org.apache.hc.core5.http.Method HTTP spec enum 2021-03-16 12:53:31 +01:00
Arturo Bernal
118e7359a1 Fixed typos javadocs and var names 2021-03-14 16:34:18 +01:00
Oleg Kalnichevski
3de88293fe Deprecated message copiers in favor of generic message builders 2021-03-11 22:47:29 +01:00
Arturo Bernal
f2e9ad3b11 Fix Typo 2021-02-10 22:09:20 +01:00
Arturo Bernal
0940d35602 Minor Improvement:
* Avoid duplicate code
* Simplify if else
* Inline variables
2021-02-05 22:18:45 +01:00
Arturo Bernal
3c9f1f85e1 Minor Improvements:
* Use Empty collections
* Unnecessary toString
2021-01-26 09:14:46 +01:00
Arturo Bernal
6a02e818ff Minor Improvements:
* Remove redundant initialization
2021-01-05 20:01:19 +01:00
Arturo Bernal
36e1bde6ff Minor Improvements:
* Add final to variable
* Unnecessary semicolon
* Use Standard Charset object
* Unnecessary conversion to String
* Simplifiable conditional expression
* Replace 'Arrays.asList()' with Collections.singletonList
* Redundant local variable. Simplify
2020-12-31 13:50:06 +01:00
Gary Gregory
400771a1a7 Add missing @Override. 2020-11-24 09:22:25 -05:00
Gary Gregory
b7f851104a Use Arrays.fill(). 2020-11-24 09:22:25 -05:00
Gary Gregory
460abd7474 Use try-with-resources. 2020-11-24 09:22:25 -05:00
Oleg Kalnichevski
c9489606d5 HTTPCLIENT-2126: AsyncCachingExec throws NPE when response body is null 2020-11-05 15:14:07 +01:00
Oleg Kalnichevski
918ac1535f RFC 3986 conformance: corrected handling of path segments by URIUtils#normalizeSyntax; optimized path segment operations 2020-09-27 12:36:29 +02:00
Oleg Kalnichevski
9bc49cc439 Fixed 'JdbcRowSetImpl is internal proprietary API and may be removed in a future release' warning 2020-09-27 12:20:32 +02:00
dirkhenselin
2520590437 Avoid updating Content-Length header in a 304 response.
I observed the following problem: `Transfer-Encoding` and
`Content-Length` headers should be mutually exclusive and because I use
chunked transfer, the `Transfer-Encoding` header is set in the response
while the `Content-Length` header is not. In case of a 304 during a
revalidation, the header contains Content-Length=0. Probably a proxy is
responsible for this, just like the comment "Some well-known proxies
respond with Content-Length=0, when returning 304" in the method
CachedHttpResponseGenerator::addMissingContentLengthHeader is saying. In
CacheEntryUpdater::mergeHeaders the Content-Length=0 is merged into the
cached entry, but the cached entry contains also a `Transfer-Encoding`
header, so in the cached entry these headers aren't mutually exclusive
anymore. Because of the `Transfer-Encoding` header the method
CachedHttpResponseGenerator::addMissingContentLengthHeader isn't fixing
the `Content-Length` header and Content-Length=0 causes returning null
instead of the cached content. IMHO the `Content-Length` header should
not be merged into the cached response in case of a 304, at least if the
cached entry contains a `Transfer-Encoding` header.
2020-08-18 14:54:36 +02:00
Carter Kozak
9866865357 HTTPCLIENT-2096: Migrate instance loggers to static fields
Note that this may change the origin of logging when classes
have been subclassed, as the logger origin will use the class
name that defined the logger where previously the subclass type
would be used. In scenarios where external libraries subclass
httpclient utilities this allows httpclient logging to maintain
the `org.apache.hc` prefix instead of inheriting arbitrary
subclass names.

Using some logging frameworks this may result in reduced churn
when httpclient components are created (new connections, for example)
because loggers are looked up once per class.
2020-07-09 11:34:48 +02:00