feat(plugin): add ReadHeaderTimeout to HTTP2HTTPS redirect

This commit is contained in:
2026-03-10 19:08:38 +08:00
parent cc0b8d0f94
commit e66f45d8be

View File

@@ -23,6 +23,7 @@ import (
"net/url" "net/url"
"strconv" "strconv"
"strings" "strings"
"time"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "github.com/fatedier/frp/pkg/config/v1"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "github.com/fatedier/frp/pkg/util/net"
@@ -52,6 +53,7 @@ func NewHTTP2HTTPSRedirectPlugin(_ PluginContext, options v1.ClientPluginOptions
Handler: http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { Handler: http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, req, buildHTTPSRedirectURL(req, opts.HTTPSPort), http.StatusFound) http.Redirect(w, req, buildHTTPSRedirectURL(req, opts.HTTPSPort), http.StatusFound)
}), }),
ReadHeaderTimeout: 60 * time.Second,
} }
go func() { go func() {