Skip to content

0.42.68

Latest

Choose a tag to compare

@bryce-anderson bryce-anderson released this 18 Nov 17:28
· 2 commits to main since this release
add173a

This is a minor maintenance release appropriate for all ServiceTalk users that contains several useful improvements and bug fixes. It is expected to be a "drop-in" replacement for prior 0.42.X releases, apart from the Behavior Changes and Security Fixes below, which tighten HTTP/1.x parsing and change a few defaults.

Changes

Behavior Changes

  • a1bd099 - transport-api: let an empty list disable TLS certificate compression (#3699)
    • Netty 4.2.20+ (this release uses 4.2.21) enables ZLIB certificate compression by default on BoringSSL/AWS-LC, adding a compress_certificate ClientHello extension. Disable it with certificateCompressionAlgorithms(Collections.emptyList()) on ClientSslConfigBuilder/ServerSslConfigBuilder, or by adding compress_certificate to jdk.tls.client.disableExtensions/jdk.tls.server.disableExtensions. SslProvider.JDK ignores the list, and JDK 27+ enables compression by default; only the system properties disable it. A compressed certificate with trailing bytes now fails the handshake (#3700).
  • 54cf5cf - http-netty: send the body when no 100 (Continue) arrives within a timeout (#3702)
    • A client request with Expect: 100-continue now sends its body after 1 second if the server sends neither 100 (Continue) nor a final response. Configure it with SingleAddressHttpClientBuilder.expectContinueTimeout(Duration): Duration.ZERO sends immediately, and Duration.ofDays(1) approximates the old wait-forever. RetryingHttpRequesterFilter no longer retries a 417 received after a streaming request body was subscribed.
  • 77e26f6 - http-netty: reset cancelled HTTP/2 streams whose request body is still streaming (#3678)
    • An HTTP/2 client now sends RST_STREAM(CANCEL) when a request is cancelled after its response finished but before its request body did, which frees the stream's slot. A gRPC client does this when a server rejects a client-streaming or bidirectional call with a Trailers-Only error.
    • A ServiceTalk HTTP/2 server closes a connection after 200 received RST_STREAM frames in 30 seconds, so a server that rejects many streaming calls on one connection can reach it. Raise it with the temporary system properties io.servicetalk.http.netty.http2.decoderEnforceMaxRstFramesPerWindow.{maxRstFramesPerWindow,secondsPerWindow} (defaults 200 and 30).
  • 3a88308 - http-api: advance readerIndex in FormUrlEncodedSerializer.deserialize (#3733)
    • Form deserialization now consumes the payload buffer, like the String and byte[] deserializers, so a second payloadBody(formDeserializer) on the same message sees an empty map. Deserialize once, or pass buffer.duplicate() to a FormUrlEncodedSerializer.
  • 23516ab - http-api: apply serializers before headers are sent (#3687)
    • On received HTTP/2 and chunked HTTP/1.1 messages, transformPayloadBody now runs the transformer immediately instead of on first subscribe, so a transformer exception or deserializer content-type mismatch is thrown from the call, not the body stream. Wrap work that must happen on subscribe in Publisher.defer. Serializers now set headers such as content-type before headers are sent, and blocking-streaming messageBody(iterable, serializer) now sends its body.
  • d4600ed - http-utils: resolve relative Location headers against the request URI (#3701)
    • Location is resolved per RFC 3986: RedirectRequestTransformer receives the resolved target (dot-segments and fragment removed), and on the multi-address client ?q keeps the current path instead of going to /. A non-relative redirect with a missing or empty scheme or host is no longer followed (the 3xx is returned), and for absolute-form requests a redirect to the same host with a different scheme is non-relative. An invalid Location still throws IllegalArgumentException, with a new message.

Security Fixes

  • fae1e4b - http-api: validate cookies appended to an existing Cookie header (#3743)
    • A second or later addCookie(...) skipped value validation, allowing CR/LF injection into the Cookie header; it now throws IllegalCharacterException. Restore the old behavior with a DefaultHttpHeadersFactory with validateValues=false.
  • 0727815 - http-api: reject control characters in HTTP response reason-phrase (#3718)
    • HttpResponseStatus.of(code, reasonPhrase) now throws for CR, LF, NUL, other control characters and DEL.
  • ae64464 - http-netty: reject a bare LF at the start of an HTTP/1.x line (#3742)
    • A bare LF at the start of a header, trailer, chunk-size or chunk-delimiter line is now rejected on clients and servers. H1SpecExceptions.Builder#allowLFWithoutCR(true) (via H1ProtocolConfigBuilder#specExceptions) re-allows it for start-line, header and trailer lines only.
  • a81ec2c - http-netty: reject invalid leading characters for a HTTP/1.1 chunk-size (#3723)
    • A chunk-size must now start with a hex digit; a leading +, space or tab is rejected on clients and servers. No opt-out.
  • 8bfa3e1 - Reject HTTP/1.x requests with more than one Host header (#3716)
    • A server now closes the connection (no 400) on a request with more than one Host line. No opt-out.
  • 3cfed83 - http-netty: close HTTP/1.1 client connections that receive more responses than requests (#3727)
    • A client connection that receives response bytes with no outstanding request (for example an unsolicited 408 or a late 100) now fails and closes. No opt-out.
  • c92b4c9 - http-netty: don't reuse HTTP/1.1 connections after rejecting Expect: 100-continue early (#3722)
    • After an early final response to an Expect: 100-continue request, the server could parse the unsent body as a new request. The server now sends Connection: close and the client closes the connection, so expect more new connections (and TLS handshakes) if you routinely reject such uploads. No opt-out; HTTP/2 is unaffected.
  • d547586 - http-netty: enforce HTTP/1.x line length limits across reads (#3744)
    • A start line, header, trailer or chunk framing line over its limit was accepted if it arrived over several reads; it is now rejected with TooLongFrameException. Raise maxStartLineLength or maxHeaderFieldLength on H1ProtocolConfigBuilder if legitimate peers need it.
  • 457a245 - http-api: don't read a leading // in a request-target as an authority (#3741)
    • A request-target without a scheme that starts with // (for example //api/v1/x) is now a path, not an authority: the server host comes from Host, and a client no longer takes Host or :authority from a //host/path target. No opt-out.

New Features

  • ecd6883 - buffer-api: expose buffer contents as byte arrays (#3696)
  • bc1883f - concurrent-api: collect Single results in input order (#3720)
  • 94255b4 - Make FormUrlEncodedSerializer public (#3681)
  • d81b6ca - http-netty: add an H1SpecExceptions option to accept header lines without a colon (#3717)

Bug Fixes

  • 04cb4af - concurrent-api: don't signal a BlockingIterator's upstream after it terminates (#3668)
    • whenCancel/beforeCancel upstream of toIterable() no longer fire after the iterator has seen the upstream terminal.
  • b2125d2 - concurrent-api: preserve demand across overlapping subscription switches (#3677)
  • 853db05 - Fail with 'Malformed content-length' for empty Content-Length value (#3715)
  • f5e071f - http-netty: avoid "Maximum active streams violated" after cancels on busy h2 connections (#3676)
  • 7f9ad8a - http-netty: ON_NEW_CONNECTION discovery ignores proxy config (#3682)
    • Clients using ON_NEW_CONNECTION discovery with a proxyConfig now go through the proxy.
  • 8bfbea6 - http-netty: don't send a payload body or trailers in responses to HEAD (#3693)
    • HTTP/2 responses to HEAD no longer carry DATA frames or trailers, so strict clients such as curl no longer send GOAWAY.
  • d0facfc - http-netty: fix hangs and early body writes with Expect: 100-continue on pipelined connections (#3725, #3726, #3728)

Dependencies

Documentation

  • bc268bf - examples-grpc-errors: demonstrate application exception mapping (#3695)

Thank you

Every idea, review, and bug-report counts and so we thought it is worth mentioning those who helped in this area. Please report any unintended omission.

@2748109647
@bardrop
@bryce-anderson
@chrisvest
@colestanfield
@daschl
@dibsy
@giaphoang
@idelpivnitskiy
@neonjava
@prakash-sandeep
@skavade00
@sudosuraj
@tuannx
@venkatchalla06