MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / RewriteSchemes

Function RewriteSchemes

pkg/webui/csp.go:137–143  ·  view source on GitHub ↗

RewriteSchemes rewrites the scheme of the provided URLs if they match a rewrite rule.

(rewrites map[string]string, baseURLs ...string)

Source from the content-addressed store, hash-verified

135
136// RewriteSchemes rewrites the scheme of the provided URLs if they match a rewrite rule.
137func RewriteSchemes(rewrites map[string]string, baseURLs ...string) []string {
138 urls := make([]string, 0, 2*len(baseURLs))
139 for _, baseURL := range baseURLs {
140 urls = append(urls, RewriteScheme(rewrites, baseURL)...)
141 }
142 return urls
143}
144
145// WebsocketSchemeRewrites contains the rewrite rules for websocket schemes.
146var WebsocketSchemeRewrites = map[string]string{

Callers 3

generateConsoleCSPStringFunction · 0.92
GenerateCSPStringFunction · 0.92
TestRewriteSchemesFunction · 0.92

Calls 1

RewriteSchemeFunction · 0.85

Tested by 1

TestRewriteSchemesFunction · 0.74