Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Improve logging and streaming for multipart file upload #228

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions httpclient/multipartrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,19 @@

for fieldName, filePaths := range files {
for _, filePath := range filePaths {
log.Debug("Adding file part", zap.String("field_name", fieldName), zap.String("file_path", filePath))
if err := addFilePart(writer, fieldName, filePath, fileContentTypes, formDataPartHeaders, log); err != nil {
log.Error("Failed to add file part", zap.Error(err))

Check warning

Code scanning / gosec

Errors unhandled. Warning

Errors unhandled.
pw.CloseWithError(err)
return
}
}
}

for key, val := range formDataFields {
log.Debug("Adding form field", zap.String("field_name", key), zap.String("field_value", val))
if err := addFormField(writer, key, val, log); err != nil {
log.Error("Failed to add form field", zap.Error(err))

Check warning

Code scanning / gosec

Errors unhandled. Warning

Errors unhandled.
pw.CloseWithError(err)
return
}
Expand Down
Loading