File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
api/src/main/java/org/asynchttpclient/multipart Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,6 @@ public boolean isRepeatable() {
205
205
protected void sendStart (OutputStream out ) throws IOException {
206
206
out .write (EXTRA_BYTES );
207
207
out .write (getPartBoundary ());
208
- out .write (CRLF_BYTES );
209
208
}
210
209
211
210
/**
@@ -215,10 +214,13 @@ protected void sendStart(OutputStream out) throws IOException {
215
214
* @throws IOException If an IO problem occurs.
216
215
*/
217
216
protected void sendDispositionHeader (OutputStream out ) throws IOException {
218
- out .write (CONTENT_DISPOSITION_BYTES );
219
- out .write (QUOTE_BYTES );
220
- out .write (MultipartEncodingUtil .getAsciiBytes (getName ()));
221
- out .write (QUOTE_BYTES );
217
+ if (getName () != null ) {
218
+ out .write (CRLF_BYTES );
219
+ out .write (CONTENT_DISPOSITION_BYTES );
220
+ out .write (QUOTE_BYTES );
221
+ out .write (MultipartEncodingUtil .getAsciiBytes (getName ()));
222
+ out .write (QUOTE_BYTES );
223
+ }
222
224
}
223
225
224
226
/**
You can’t perform that action at this time.
0 commit comments