mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-03 22:33:28 +00: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:
parent
b79f86f256
commit
37da91cfe7
3 changed files with 29 additions and 17 deletions
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue