Skip to content
Snippets Groups Projects
Commit 5b9bb4188933 authored by Christophe de Vienne's avatar Christophe de Vienne
Browse files

cmd: WithUI: add 'ExcludePrefix' option

parent 67524076bb1d
No related branches found
No related tags found
No related merge requests found
Pipeline #114940 failed
......@@ -75,9 +75,10 @@
}
type UIConfig struct {
Name string
Description string
Prefix string
Name string
Description string
Prefix string
ExcludePrefix []string
}
func WithUI(uifs fs.FS, cfg *UIConfig) Option {
......@@ -118,6 +119,13 @@
next.ServeHTTP(rw, r)
}
}
for _, p := range cfg.ExcludePrefix {
if strings.HasPrefix(r.URL.Path, p) {
next.ServeHTTP(rw, r)
return
}
}
accepted, err := accept.Negotiate(
r.Header.Get("Accept"),
"text/html", "application/json")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment