Skip to content

Commit 3d41ef0

Browse files
authored
Merge pull request #1725 from NASA-AMMOS/dev/fix-http2-content-bug
Fix workspace server content-length bug
2 parents 9faa95c + 08ea2c5 commit 3d41ef0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

workspace-server/src/main/java/gov/nasa/jpl/aerie/workspace/server/WorkspaceBindings.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,11 @@ private void get(Context context) throws NoSuchWorkspaceException {
235235

236236
try {
237237
final var fileStream = workspaceService.loadFile(pathInfo.workspaceId, pathInfo.filePath());
238-
final var fileReader = new BufferedInputStream(fileStream.readingStream());
238+
final var inputStream = fileStream.readingStream();
239239
context.header("x-render-type", workspaceService.getFileType(pathInfo.filePath).name());
240240
context.contentType(ContentType.OCTET_STREAM);
241241
context.header("Content-Disposition", "attachment; filename=\"" + pathInfo.fileName() + "\"");
242-
context.header("Content-Length", "" + fileStream.fileSize());
243-
context.status(200).result(fileReader);
242+
context.status(200).result(inputStream);
244243
} catch (IOException | SQLException e) {
245244
context.status(500).result("Could not load file " + pathInfo.fileName());
246245
}

0 commit comments

Comments
 (0)