MM-13606 Remove consumeAndClose and clean up integration response handling (#10066)
* MM-13606 Remove consumeAndClose * Allow overriding HTTPService's request timeout * MM-13606 Clean up integration response handling * Properly close httptest servers * Address feedback * Only call buf.Bytes when necessary * Properly check for errors in doOutgoingWebhookRequest * Add comment explaining ignored ioutil.ReadAll errors
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e67fe4c89d
Коммит
1a3ccaf305
@@ -8,8 +8,6 @@ import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -596,14 +594,6 @@ func (a *App) OriginChecker() func(*http.Request) bool {
|
||||
return nil
|
||||
}
|
||||
|
||||
// This is required to re-use the underlying connection and not take up file descriptors
|
||||
func consumeAndClose(r *http.Response) {
|
||||
if r.Body != nil {
|
||||
io.Copy(ioutil.Discard, r.Body)
|
||||
r.Body.Close()
|
||||
}
|
||||
}
|
||||
|
||||
func runSecurityJob(s *Server) {
|
||||
doSecurity(s)
|
||||
model.CreateRecurringTask("Security", func() {
|
||||
|
||||
Ссылка в новой задаче
Block a user