Skip to content

Commit 3237211

Browse files
committed
chore: Refactor multipart request handling and logging
1 parent e1e4793 commit 3237211

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

httpclient/multipartrequest.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (c *Client) DoMultiPartRequest(method, endpoint string, files map[string][]
8080
cookiejar.ApplyCustomCookies(req, c.clientConfig.ClientOptions.Cookies.CustomCookies, c.Logger)
8181

8282
// Apply common headers
83-
applyCommonHeaders(req, contentType, endpoint, c)
83+
setMultiPartHeaders(req, contentType, endpoint, c)
8484

8585
req = req.WithContext(ctx)
8686

@@ -323,8 +323,8 @@ func logMultiPartRequestBody(body *bytes.Buffer, log logger.Logger) {
323323
log.Info("Request body preview", zap.String("body", loggedBody))
324324
}
325325

326-
// applyCommonHeaders sets common headers for the request
327-
func applyCommonHeaders(req *http.Request, contentType string, endpoint string, c *Client) {
326+
// setMultiPartHeaders sets common headers for the request
327+
func setMultiPartHeaders(req *http.Request, contentType string, endpoint string, c *Client) {
328328
req.Header.Set("Content-Type", contentType)
329329

330330
headerHandler := headers.NewHeaderHandler(req, c.Logger, c.APIHandler, c.AuthTokenHandler)

0 commit comments

Comments
 (0)