mirror of
https://github.com/wahyd4/caddy.git
synced 2026-08-09 05:16:13 +10: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:
@@ -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