mirror of
https://github.com/strukturag/nextcloud-spreed-signaling.git
synced 2023-10-21 07:33:40 -05:00
Remove unnecessary dependency golang.org/x/net
This commit is contained in:
+7
-2
@@ -36,7 +36,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/dlintw/goconf"
|
||||
"golang.org/x/net/context/ctxhttp"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -248,8 +247,14 @@ func performRequestWithRedirects(ctx context.Context, client *http.Client, req *
|
||||
req.Body = ioutil.NopCloser(bytes.NewReader(body))
|
||||
req.ContentLength = int64(len(body))
|
||||
}
|
||||
resp, err = ctxhttp.Do(ctx, client, req)
|
||||
resp, err = client.Do(req.WithContext(ctx))
|
||||
if err != nil {
|
||||
// Prefer context error if it has been cancelled.
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
err = ctx.Err()
|
||||
default:
|
||||
}
|
||||
if e, ok := err.(*url.Error); !ok || resp == nil || e.Err != ErrUseLastResponse {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user