154 Commits

Author SHA1 Message Date
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
Carter Kozak
84bd290954
HTTPCLIENT-2095: Use slf4j interpolation instead of string concatenation where possible (#232) 2020-07-02 17:51:43 +02:00
Gary Gregory
d1c4199db3
No need to use the type name of an input arg in the method name. (#208)
* No need to use the type name of an input arg in the method name.

* Do not use input type names in method names.
2020-01-29 19:20:05 -05:00
Michael Osipov
26991b8059 HTTPCLIENT-2036: CacheValidityPolicy should use TimeValue
This closes #201
2020-01-10 11:01:45 +01:00
Ryan Schmitt
3aec96d3db Upgraded HttpCore to version 5.0-beta11 2020-01-07 15:41:18 +01:00
Scott Gifford
a8fc99f4a2 HttpByteArrayCacheEntrySerializer minor code cleanup for HTTPCORE-615.
MemcachedCacheEntryHttp inner class NoAgeCacheValidityPolicy should be static.
Add missing javadoc @param and @return entries to MemcachedCacheEntryHttp.
Remove extra blank lines.
2020-01-07 09:30:02 +01:00
Gary Gregory
634886ab61 [HTTPCLIENT-2046] Rename AuthSchemes enum to StandardAuthScheme final class
Modeled after StandardCharsets, the new class indicates a non-exhaustive
list of standard auth schemes by name supported by the HttpClient. The
previous enum suffered from two issues:

* it was exhaustive implying that no more auth schemes can be supported
* its sole purpose was to contain an id for the declared auth scheme;
  the enum values theirselves were never used directly

This closes #196
2020-01-01 21:57:53 +01:00