mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 10:17:17 +08:00
feat: 优化防跨站配置创建
This commit is contained in:
@@ -27,10 +27,10 @@ func NewRouter(t *gotext.Locale, middlewares *middleware.Middlewares, http *rout
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func NewHttp(conf *koanf.Koanf, r *chi.Mux) (*hlfhr.Server, error) {
|
||||
func NewHttp(conf *koanf.Koanf, mux *chi.Mux) (*hlfhr.Server, error) {
|
||||
srv := hlfhr.New(&http.Server{
|
||||
Addr: fmt.Sprintf(":%d", conf.MustInt("http.port")),
|
||||
Handler: http.AllowQuerySemicolons(r),
|
||||
Handler: mux,
|
||||
MaxHeaderBytes: 2048 << 20,
|
||||
})
|
||||
srv.HttpOnHttpsPortErrorHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user