fix(webhook): set a ReadHeaderTimeout on the forge webhook receivers

Both listen on the network without a header-read bound, the slowloris surface. Matches the timeout the other daemon servers already carry.
This commit is contained in:
sam committed 2026-10-02 22:45:02 +10:00
1 parent 9d7a7df496
commit eb624e53c6
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1704,7 +1704,7 @@ func (b *boot) setupForgeWebhook() {
receiver := forgewebhook.New(secretValue, cfg.Dispatch.Trigger, cfg.Label, cfg.BotUser, b.d.PublishTask, b.d.PublishReaction, log)
host, port := parseListenAddr(cfg.Forge.WebhookAddr, "0.0.0.0", 8645)
addr := fmt.Sprintf("%s:%d", host, port)
srv := &http.Server{Addr: addr, Handler: receiver}
srv := &http.Server{Addr: addr, Handler: receiver, ReadHeaderTimeout: 5 * time.Second}
b.startGateways = append(b.startGateways, func() {
go func() {
+1 -1
View File
@@ -79,7 +79,7 @@ func (g *Gateway) Start(ctx context.Context, client messaging.ChatContract, life
}
addr := fmt.Sprintf("%s:%d", g.Host, g.Port)
g.server = &http.Server{Addr: addr, Handler: mux}
g.server = &http.Server{Addr: addr, Handler: mux, ReadHeaderTimeout: 5 * time.Second}
server := g.server
g.mu.Unlock()