mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-22 05:36:16 +00:00
Configure client against DOS
This commit is contained in:
parent
ecf391dcbf
commit
87bfa79f71
|
@ -86,7 +86,9 @@ func NewClient(ctx context.Context, user *user_model.User, pubID string) (c *Cli
|
|||
client: &http.Client{
|
||||
Transport: &http.Transport{
|
||||
Proxy: proxy.Proxy(),
|
||||
MaxConnsPerHost: 20,
|
||||
},
|
||||
Timeout: time.Duration(5 * time.Second),
|
||||
},
|
||||
algs: setting.HttpsigAlgs,
|
||||
digestAlg: httpsig.DigestAlgorithm(setting.Federation.DigestAlgorithm),
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/models/forgefed"
|
||||
|
@ -160,9 +159,6 @@ func RepositoryInbox(ctx *context.APIContext) {
|
|||
}
|
||||
}
|
||||
|
||||
// wait 5 sec.
|
||||
time.Sleep(5 * time.Second)
|
||||
|
||||
ctx.Status(http.StatusNoContent)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue