Skip to content

Commit

Permalink
Further followups to NAS-2556 via https://sbforge.org/fisheye/cru/CR-…
Browse files Browse the repository at this point in the history
  • Loading branch information
csrster committed Oct 7, 2016
1 parent d61deb3 commit abdf04a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ private void doGetFile(Request request, Response response) {
response.addHeaderField("Content-Type", "application/octet-stream");
}
response.setStatus(OK_RESPONSE_CODE);
response.getOutputStream().flush();
FileUtils.writeFileToStream(tempFile, response.getOutputStream());
} finally {
if (tempFile != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ public void setStatus(int statusCode, String reason) {
* @param value The value of the header
*/
public void addHeaderField(String name, String value) {
if (hr.isCommitted()) {
log.warn("Writing a header {}:{} after the http response is committed.", name, value);
}
hr.addHeader(name, value);
}

Expand Down

0 comments on commit abdf04a

Please sign in to comment.