mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-24 08:57:03 -05:00
Configure client against DOS
This commit is contained in:
parent
ecf391dcbf
commit
87bfa79f71
2 changed files with 3 additions and 5 deletions
|
@ -85,8 +85,10 @@ func NewClient(ctx context.Context, user *user_model.User, pubID string) (c *Cli
|
|||
c = &Client{
|
||||
client: &http.Client{
|
||||
Transport: &http.Transport{
|
||||
Proxy: proxy.Proxy(),
|
||||
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