Skip to content

Commit

Permalink
Merge branch 'release/0.7.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas committed Nov 2, 2022
2 parents ba26b96 + 05a22d8 commit 30701e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion request.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ func buildRequestContent(log *logger.Logger, options *Options) (content *Content
return nil, errors.Errorf("Empty value for multipart form field %s", key)
}
partHeader := textproto.MIMEHeader{}
partHeader.Set("Content-Disposition", fmt.Sprintf("form-data; name=\"%s\"; filename=\"%s\"", key, value))
if len(options.AttachmentType) > 0 {
partHeader.Add("Content-Type", options.AttachmentType)
}
Expand All @@ -415,7 +416,6 @@ func buildRequestContent(log *logger.Logger, options *Options) (content *Content
if written == 0 {
return nil, errors.Errorf("Missing/Empty Attachment for multipart form field %s", key)
}
partHeader.Add("Content-Disposition", fmt.Sprintf("form-data; name=\"%s\"; filename=\"%s\"; filelength=%d", key, value, written))
log.Tracef("Wrote %d bytes to multipart form field %s", written, key)
} else {
if err := writer.WriteField(key, value); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ package request
var commit string

// VERSION is the version of this library
var VERSION = "0.7.11" + commit
var VERSION = "0.7.12" + commit

0 comments on commit 30701e6

Please sign in to comment.