Skip to content

Commit 9dbc693

Browse files
committedFeb 3, 2022
Exclude unix protocols from request processing in closing strategy
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
1 parent e236c09 commit 9dbc693

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheConnectionClosingStrategy.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -63,12 +63,15 @@ void close(ClientRequest clientRequest, HttpUriRequest request, CloseableHttpRes
6363
* Strategy that aborts Apache HttpRequests for the case of Chunked Stream, closes the stream, and response next.
6464
*/
6565
class GracefulClosingStrategy implements ApacheConnectionClosingStrategy {
66+
private static final String UNIX_PROTOCOL = "unix";
67+
6668
static final GracefulClosingStrategy INSTANCE = new GracefulClosingStrategy();
6769

6870
@Override
6971
public void close(ClientRequest clientRequest, HttpUriRequest request, CloseableHttpResponse response, InputStream stream)
7072
throws IOException {
71-
if (response.getEntity() != null && response.getEntity().isChunked()) {
73+
if (response.getEntity() != null && response.getEntity().isChunked()
74+
&& !request.getURI().getScheme().equals(UNIX_PROTOCOL)) {
7275
request.abort();
7376
}
7477
try {

0 commit comments

Comments
 (0)