Skip to content

Commit 29d29c9

Browse files
AXIS2-6101 Implement getResponseContentEncoding() in H2 transports
H2RequestImpl and H2StreamingRequestImpl implement the new Request.getResponseContentEncoding() method added for the HC5 5.6+ double-decompression fix. Both return null since the HTTP/2 async pipeline handles decompression before the response body is exposed. Fixes Java 17 CI build failure — these classes implement the Request interface and must provide the new abstract method. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f494b79 commit 29d29c9

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

modules/transport-h2/src/main/java/org/apache/axis2/transport/h2/impl/httpclient5/H2RequestImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ public InputStream getResponseContent() throws IOException {
224224
return null;
225225
}
226226

227+
@Override
228+
public String getResponseContentEncoding() {
229+
// HTTP/2 async responses use SimpleHttpResponse which does not expose
230+
// entity content encoding separately. Return null (no encoding) since
231+
// HC5's async pipeline handles decompression before we see the body.
232+
return null;
233+
}
234+
227235
@Override
228236
public int getStatusCode() {
229237
return response != null ? response.getCode() : -1;

modules/transport-h2/src/main/java/org/apache/axis2/transport/h2/impl/httpclient5/H2StreamingRequestImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ public InputStream getResponseContent() throws IOException {
278278
return null;
279279
}
280280

281+
@Override
282+
public String getResponseContentEncoding() {
283+
// HTTP/2 streaming responses use SimpleHttpResponse which does not
284+
// expose entity content encoding separately. Return null since
285+
// HC5's async pipeline handles decompression before we see the body.
286+
return null;
287+
}
288+
281289
@Override
282290
public void releaseConnection() {
283291
log.trace("Releasing HTTP/2 streaming connection resources");

0 commit comments

Comments
 (0)