Repository navigation
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_certificateClientHello extension. Disable it withcertificateCompressionAlgorithms(Collections.emptyList())onClientSslConfigBuilder/ServerSslConfigBuilder, or by addingcompress_certificatetojdk.tls.client.disableExtensions/jdk.tls.server.disableExtensions.SslProvider.JDKignores 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).
- Netty 4.2.20+ (this release uses 4.2.21) enables ZLIB certificate compression by default on BoringSSL/AWS-LC, adding a
- 54cf5cf - http-netty: send the body when no 100 (Continue) arrives within a timeout (#3702)
- A client request with
Expect: 100-continuenow sends its body after 1 second if the server sends neither 100 (Continue) nor a final response. Configure it withSingleAddressHttpClientBuilder.expectContinueTimeout(Duration):Duration.ZEROsends immediately, andDuration.ofDays(1)approximates the old wait-forever.RetryingHttpRequesterFilterno longer retries a 417 received after a streaming request body was subscribed.
- A client request with
- 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_STREAMframes in 30 seconds, so a server that rejects many streaming calls on one connection can reach it. Raise it with the temporary system propertiesio.servicetalk.http.netty.http2.decoderEnforceMaxRstFramesPerWindow.{maxRstFramesPerWindow,secondsPerWindow}(defaults 200 and 30).
- An HTTP/2 client now sends
- 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 passbuffer.duplicate()to aFormUrlEncodedSerializer.
- Form deserialization now consumes the payload buffer, like the String and byte[] deserializers, so a second
- 23516ab - http-api: apply serializers before headers are sent (#3687)
- On received HTTP/2 and chunked HTTP/1.1 messages,
transformPayloadBodynow 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 inPublisher.defer. Serializers now set headers such ascontent-typebefore headers are sent, and blocking-streamingmessageBody(iterable, serializer)now sends its body.
- On received HTTP/2 and chunked HTTP/1.1 messages,
- d4600ed - http-utils: resolve relative
Locationheaders against the request URI (#3701)Locationis resolved per RFC 3986:RedirectRequestTransformerreceives the resolved target (dot-segments and fragment removed), and on the multi-address client?qkeeps 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 invalidLocationstill throwsIllegalArgumentException, 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 theCookieheader; it now throwsIllegalCharacterException. Restore the old behavior with aDefaultHttpHeadersFactorywithvalidateValues=false.
- A second or later
- 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)(viaH1ProtocolConfigBuilder#specExceptions) re-allows it for start-line, header and trailer lines only.
- A bare LF at the start of a header, trailer, chunk-size or chunk-delimiter line is now rejected on clients and servers.
- 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.
- A chunk-size must now start with a hex digit; a leading
- 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
Hostline. No opt-out.
- A server now closes the connection (no 400) on a request with more than one
- 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
408or a late100) now fails and closes. No opt-out.
- A client connection that receives response bytes with no outstanding request (for example an unsolicited
- 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-continuerequest, the server could parse the unsent body as a new request. The server now sendsConnection: closeand 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.
- After an early final response to an
- 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. RaisemaxStartLineLengthormaxHeaderFieldLengthonH1ProtocolConfigBuilderif legitimate peers need it.
- 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
- 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 fromHost, and a client no longer takesHostor:authorityfrom a//host/pathtarget. No opt-out.
- A request-target without a scheme that starts with
New Features
- ecd6883 - buffer-api: expose buffer contents as byte arrays (#3696)
- bc1883f - concurrent-api: collect Single results in input order (#3720)
- 94255b4 - Make
FormUrlEncodedSerializerpublic (#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/beforeCancelupstream oftoIterable()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_CONNECTIONdiscovery ignores proxy config (#3682)- Clients using
ON_NEW_CONNECTIONdiscovery with aproxyConfignow go through the proxy.
- Clients using
- 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-continueon pipelined connections (#3725, #3726, #3728)
Dependencies
Documentation
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