eclipse-ee4j / eclipse-ee4j/jersey
ApacheConnector close() throws exception if body not consumed
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
Works with jersey-apache-connector 2.21.1
```
public static void main(String... args) {
ClientConfig clientConfig = new ClientConfig().connectorProvider(new ApacheConnectorProvider());
Client client = ClientBuilder.newClient(clientConfig);
Response response = client.target("http://www.apache.org/").request(TEXT_HTML_TYPE).get();
out.printf("Status: %d%n", response.getStatus());
// uncomment to make test pass
// response.readEntity(String.class);
response.close();
}
```
#### Affected Versions
[2.22.2]
Contributor guide
Research direction
Run the provided Java example with jersey-apache-connector 2.21.1 and the affected 2.22.2 version, comparing response.close() with and without response.readEntity(String.class). Trace the ApacheConnector close path to identify why an unconsumed body causes an exception, then verify that closing the response works without consuming the body.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100