3 Commits

Author SHA1 Message Date
f91090b35e Func rename 2025-07-10 19:09:29 +05:30
5b380a294b expose ServeMux 2025-07-10 19:05:31 +05:30
ddb4b35181 helmet.go removed wildcard directive. 2025-05-18 22:48:11 +05:30
2 changed files with 7 additions and 2 deletions

View File

@@ -268,7 +268,7 @@ func (csp *CSP) value() string {
sb.WriteString(fmt.Sprintf( sb.WriteString(fmt.Sprintf(
"style-src %s; ", "style-src %s; ",
cspNormalised(csp.StyleSrc, []string{"self", "https:", "unsafe-inline"}), cspNormalised(csp.StyleSrc, []string{"self", "unsafe-inline"}),
)) ))
sb.WriteString(fmt.Sprintf( sb.WriteString(fmt.Sprintf(
@@ -288,7 +288,7 @@ func (csp *CSP) value() string {
sb.WriteString(fmt.Sprintf( sb.WriteString(fmt.Sprintf(
"font-src %s; ", "font-src %s; ",
cspNormalised(csp.FontSrc, []string{"self", "https:", "data:"}), cspNormalised(csp.FontSrc, []string{"self", "data:"}),
)) ))
sb.WriteString(fmt.Sprintf( sb.WriteString(fmt.Sprintf(

View File

@@ -20,6 +20,11 @@ func NewRouter() *Router {
return r return r
} }
// Mux DO NOT USE it for routing, exposed only for edge cases.
func (r *Router) Mux() *http.ServeMux {
return r.mux
}
// Use will register middleware(s) with router stack // Use will register middleware(s) with router stack
func (r *Router) Use(h ...func(http.Handler) http.Handler) { func (r *Router) Use(h ...func(http.Handler) http.Handler) {
if r == nil { if r == nil {