Skip to content

Commit fb2daac

Browse files
author
Petri Louhelainen
committed
Send Content-Disposition header without filename too
Some servers, e.g. Jetty save multipart parts with filename present in content disposition header to disk. To prevent this we want to be able to send Content-Disposition header with name only (so we can easily access it) but not store bytes to disk to prevent unwanted IO.
1 parent 169051c commit fb2daac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/ning/http/multipart/FilePart.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public FilePart(String name, String fileName, File file, String contentType, Str
147147
*/
148148
protected void sendDispositionHeader(OutputStream out) throws IOException {
149149
String filename = this.source.getFileName();
150+
super.sendDispositionHeader(out);
150151
if (filename != null) {
151-
super.sendDispositionHeader(out);
152152
out.write(FILE_NAME_BYTES);
153153
out.write(QUOTE_BYTES);
154154
out.write(MultipartEncodingUtil.getAsciiBytes(filename));

0 commit comments

Comments
 (0)