@@ -353,8 +353,8 @@ func TestMultipartLargeFile(t *testing.T) {
353
353
c := dcnl ()
354
354
resp , err := c .R ().
355
355
SetFile ("file" , filepath .Join (getTestDataPath (), "test-img.png" )).
356
- SetMultipartBoundary ("custom-boundary-" + strconv .FormatInt (time .Now ().Unix (), 10 )).
357
- SetHeader ( "Content-Type" , "image/png" ).
356
+ SetMultipartBoundary ("custom-boundary-" + strconv .FormatInt (time .Now ().Unix (), 10 )).
357
+ SetContentType ( "image/png" ).
358
358
Post (ts .URL + "/upload" )
359
359
assertNil (t , err )
360
360
assertNotNil (t , resp )
@@ -365,8 +365,8 @@ func TestMultipartLargeFile(t *testing.T) {
365
365
c := dcnl ()
366
366
_ , err := c .R ().
367
367
SetFile ("file" , filepath .Join (getTestDataPath (), "test-img.png" )).
368
- SetMultipartBoundary (`"custom-boundary-"` + strconv .FormatInt (time .Now ().Unix (), 10 )).
369
- SetHeader ( "Content-Type" , "image/png" ).
368
+ SetMultipartBoundary (`"custom-boundary-"` + strconv .FormatInt (time .Now ().Unix (), 10 )).
369
+ SetContentType ( "image/png" ).
370
370
Post (ts .URL + "/upload" )
371
371
assertNotNil (t , err )
372
372
assertEqual (t , "mime: invalid boundary character" , err .Error ())
@@ -616,8 +616,8 @@ func TestMultipartRequest_createMultipart(t *testing.T) {
616
616
617
617
req1 := c .R ().
618
618
SetFile ("file" , filepath .Join (getTestDataPath (), "test-img.png" )).
619
- SetMultipartBoundary ("custom-boundary-" + strconv .FormatInt (time .Now ().Unix (), 10 )).
620
- SetHeader ( "Content-Type" , "image/png" )
619
+ SetMultipartBoundary ("custom-boundary-" + strconv .FormatInt (time .Now ().Unix (), 10 )).
620
+ SetContentType ( "image/png" )
621
621
622
622
mw := multipart .NewWriter (new (bytes.Buffer ))
623
623
err := createMultipart (mw , req1 )
@@ -638,7 +638,7 @@ func TestMultipartRequest_createMultipart(t *testing.T) {
638
638
639
639
req1 := c .R ().
640
640
SetFile ("file" , filepath .Join (getTestDataPath (), "test-img.png" )).
641
- SetHeader ( "Content-Type" , "image/png" )
641
+ SetContentType ( "image/png" )
642
642
643
643
mw := multipart .NewWriter (new (bytes.Buffer ))
644
644
err := createMultipart (mw , req1 )
0 commit comments