mirror of
https://github.com/moby/moby.git
synced 2026-06-30 19:58:03 +00:00
Merge pull request #52349 from thaJeztah/splunk_requestwithcontext
daemon/logger/splunk: tryPostMessages use http.NewRequestWithContext
This commit is contained in:
@@ -471,11 +471,10 @@ func (l *splunkLogger) tryPostMessages(ctx context.Context, messages []*splunkMe
|
||||
return err
|
||||
}
|
||||
}
|
||||
req, err := http.NewRequest(http.MethodPost, l.url, bytes.NewBuffer(buffer.Bytes()))
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodPost, l.url, bytes.NewBuffer(buffer.Bytes()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
req.Header.Set("Authorization", l.auth)
|
||||
// Tell if we are sending gzip compressed body
|
||||
if l.gzipCompression {
|
||||
|
||||
Reference in New Issue
Block a user