Skip to content

Commit e1e4793

Browse files
committed
chore: Apply custom cookies and headers in multipart request handling
1 parent 89f760b commit e1e4793

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

httpclient/multipartrequest.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ func (c *Client) DoMultiPartRequest(method, endpoint string, files map[string][]
7676
return nil, err
7777
}
7878

79+
// Apply custom cookies
80+
cookiejar.ApplyCustomCookies(req, c.clientConfig.ClientOptions.Cookies.CustomCookies, c.Logger)
81+
7982
// Apply common headers
8083
applyCommonHeaders(req, contentType, endpoint, c)
8184

@@ -323,10 +326,6 @@ func logMultiPartRequestBody(body *bytes.Buffer, log logger.Logger) {
323326
// applyCommonHeaders sets common headers for the request
324327
func applyCommonHeaders(req *http.Request, contentType string, endpoint string, c *Client) {
325328
req.Header.Set("Content-Type", contentType)
326-
req.Header.Set("Accept", "application/json")
327-
328-
// Apply custom cookies and headers
329-
cookiejar.ApplyCustomCookies(req, c.clientConfig.ClientOptions.Cookies.CustomCookies, c.Logger)
330329

331330
headerHandler := headers.NewHeaderHandler(req, c.Logger, c.APIHandler, c.AuthTokenHandler)
332331
headerHandler.SetRequestHeaders(endpoint)

0 commit comments

Comments
 (0)