All Versions
8
Latest Version
Avg Release Cycle
-
Latest Release
-

Changelog History

  • v1.6.0 Changes

    30-5-2021

    • โž• Added HttpCache.Listener.
    • โž• Added TaggableRequest. This facilitates carrying application-specific data throughout interceptors & listeners. ```java var interceptor = Interceptor.create(request -> { var taggableRequest = TaggableRequest.from(request); var myContext = taggableRequest.tag(MyContext.class).orElseGet(MyContext::empty); ... }); var client = Methanol.newBuilder() .interceptor(interceptor) .build();

    var myContext = ... var request = MutableRequest.GET("https://example.com") .tag(MyContext.class, myContext); var response = client.send(request, BodyHandlers.ofString());

    
    * ๐Ÿ›  Fixed disk cache possibly manipulating the disk index concurrently. This could happen if an index
      update is delayed, as the scheduler mistakenly ran the index write immediately after the delay evaluates instead
      of queuing it with the sequential index executor.
    * ๐Ÿ›  Fixed `TimeoutSubscriber` (used in `MoreBodySubscribers::withReadTimeout`) possibly calling
      downstream's `onNext` & `onError` concurrently. This could happen if timeout evaluates while downstream's
      `onNext` is still executing.
    * ๐Ÿšฆ Made `AsyncBodyDecoder` ignore upstream signals after decoding in `onNext` fails and the error is
      reported to `onError`. This prevents receiving further `onXXXX` by upstream if it doesn't immediately
      detect cancellation.
    * ๐ŸŒฒ Made the disk cache catch and log `StoreCorruptionException` thrown when opening an entry. This is
      done instead of rethrowing.
    * `Methanol` now always validates request's `URI` after being resolved with the optional base `URI`.
      Previously, the `URI` was only validated if there was a base `URI`.
    * โฌ†๏ธ Upgraded [gson to 2.8.7](https://github.com/google/gson/blob/master/CHANGELOG.md#version-287).
    
  • v1.5.0 Changes

    14-5-2021

    • Methanol now has an [RFC-compliant][httpcaching_rfc] HTTP cache! It can store entries on disk or in memory. Give it a try!

      void cache() throws InterruptedException, IOException {
      var cache = HttpCache.newBuilder()
          .cacheOnDisk(Path.of("cache-dir"), 100 * 1024 * 1024)
          .build();
      var client = Methanol.newBuilder()
          .cache(cache)
          .build();
      
      var request = MutableRequest.GET("https://i.imgur.com/NYvl8Sy.mp4");
      var response = (CacheAwareResponse<Path>) client.send(
          request, BodyHandlers.ofFile(Path.of("banana_cat.mp4")));
      
      System.out.printf(
          "%s (CacheStatus: %s, elapsed: %s)%n",
          response,
          response.cacheStatus(),
          Duration.between(response.timeRequestSent(), response.timeResponseReceived()));
      
      cache.close();
      }
      
    • โž• Added CacheControl to model the Cache-Control header and its directives. This is complementary to the new cache as all configuration is communicated through Cache-Control.

    • ๐Ÿ—„ Interceptors have been reworked. The old naming convention is deprecated. An interceptor is now either a client or a backend interceptor instead of a pre/post decoration interceptor, where 'backend' refers to Methanol's backing HttpClient. The cache intercepts requests after client but before backend interceptors. It was tempting to name the latter 'network interceptors', but that seemed rather confusing as not all 'network' requests can be intercepted (HttpClient can make its own intermediate requests like redirects & retries).

    • โž• Added HttpStatus, which contains functions for checking response codes.

    • โž• Added ForwardingEncoder & ForwardingDecoder. These are meant for easier installation of adapters from the classpath.

    • ๐ŸŒฒ System.Logger API is now used instead of java.util.logging.

    • ๐Ÿ›  Fix: Don't attempt to decompress responses to HEADs. This fixed failures like unexpected end of gzip stream.

    • ๐Ÿ›  Fix: Decompressed responses now have their stale Content-Encoding & Content-Length headers removed.

    • ๐Ÿ”„ Changed reactor dependency to API scope in the methanol-jackson-flux adapter.

    • ๐Ÿš€ Upgraded Jackson to 2.12.3.

    • ๐Ÿš€ Upgraded Reactor to 3.4.6.

    • ๐Ÿ†• New project website!

  • v1.4.1 Changes

    26-9-2020

    • โšก๏ธ Updated dependencies.
    • ๐Ÿ›  Fix: Autodetect if a deflated stream is zlib-wrapped or not to not crash when some servers incorrectly send raw deflated bytes for the deflate encoding.
  • v1.4.0 Changes

    27-7-2020

    • Multipart progress tracking.
  • v1.3.0 Changes

    22-6-2020

    • 0๏ธโƒฃ Default read timeout in Methanol client.
    • API for tracking upload/download progress.
    • High-level client interceptors.
  • v1.2.0 Changes

    1-5-2020

    • Reactive JSON adapters with Jackson and Reactor.
    • Common MediaType constants.
    • XML adapters with JAXB.
  • v1.1.0 Changes

    17-4-2020

    • ๐Ÿš€ First "main-stream" release.
  • v1.0.0 Changes

    25-3-2020

    • ๐Ÿš€ Dummy release.