Skip to content

Commit

Permalink
Merge branch 'master' into bm/release-3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
rwi committed Dec 30, 2018
2 parents 9dd7d08 + 58512bf commit e199ab1
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -168,7 +169,14 @@ public void sendInResponse(HttpServletRequest request, HttpServletResponse respo
contentType = "application/octet-stream";
}
response.setContentType(contentType);
response.setCharacterEncoding(characterEncoding);
// TODO setting the encoding here is not that useful because we are using the stream and not
// the writer. Moreover, binary types have no character encoding and for text types the
// attachment should tell us the encoding of the content.
// can't set 'no encoding' with null (to overwrite value set by EncodingFilter), null is
// ignored. Empty string causes a warning.
if (StringUtils.isNotBlank(characterEncoding)) {
response.setCharacterEncoding(characterEncoding);
}
long contentLength = this.getContentLength();
// RFC 2183 --> http://www.ietf.org/rfc/rfc2183.txt
String dispositionType = dipositionTypeAsAttachment ? "attachment" : "inline";
Expand Down

0 comments on commit e199ab1

Please sign in to comment.