eclipse-ee4j / eclipse-ee4j/jersey

jersey-netty-connector - Post commit b2316648590c368aeb5b3729b29af300ab5c0bea unable to download file sent in a redirect

Open
#5,881 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Client calls URL1 which does a redirect with the Location set to a .csv file
With change b2316648590c368aeb5b3729b29af300ab5c0bea, the stream is closed before the file can be downloaded due connector being shutdown.

newConnector.execute(newReq, this.redirectUriHistory, new CompletableFuture() {
```
public boolean complete(ClientResponse value) {
**newConnector.close();**
return JerseyClientHandler.this.responseAvailable.complete(value);
}

public boolean completeExceptionally(Throwable ex) {
newConnector.close();
return JerseyClientHandler.this.responseAvailable.completeExceptionally(ex);
}
});
```
Req 1
DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 302 Found
Server: Some Server
Date: Wed, 12 Mar 2025 22:11:40 GMT
Connection: close
Location: https://xxxx.com/somePath/8518C64490C6B934CA258C41004CF9DC/$file/someDirFeb25-347.csv
Strict-Transport-Security: max-age=604800
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: sniff
content-length: 0

Redirected Req
DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Server: Some server
Date: Wed, 12 Mar 2025 22:12:28 GMT
Last-Modified: Sun, 02 Mar 2025 14:01:29 GMT
Content-Type: application/octet-stream
ETag: W/"MTAtMDAwMi0wLUNBMjU4QzQxMDA0RDA5RjctODUxOEM2NDQ5MEM2QjkzNENBMjU4QzQxMDA0Q0Y5REM="
Strict-Transport-Security: max-age=604800
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: sniff
**content-length: 1425188**

When reading the response stream I get
java.io.IOException: java.io.IOException: Stream closed

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.