mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-25 12:20:34 +08:00
fix module import paths and add cors to admin endpoints
fix go module refs and add cors to admin endpoints
This commit is contained in:
6
admin.go
6
admin.go
@ -13,6 +13,8 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/rs/cors"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -46,8 +48,10 @@ func StartAdmin(addr string) error {
|
||||
mux.Handle(route.Pattern, route)
|
||||
}
|
||||
|
||||
handler := cors.Default().Handler(mux)
|
||||
|
||||
cfgEndptSrv = &http.Server{
|
||||
Handler: mux,
|
||||
Handler: handler,
|
||||
ReadTimeout: 5 * time.Second,
|
||||
ReadHeaderTimeout: 5 * time.Second,
|
||||
IdleTimeout: 5 * time.Second,
|
||||
|
Reference in New Issue
Block a user