MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / parseOrigins

Function parseOrigins

server-source-code/internal/middleware/cors.go:136–145  ·  view source on GitHub ↗
(origin string)

Source from the content-addressed store, hash-verified

134}
135
136func parseOrigins(origin string) []string {
137 parts := strings.Split(origin, ",")
138 out := make([]string, 0, len(parts))
139 for _, p := range parts {
140 if s := strings.TrimSpace(p); s != "" {
141 out = append(out, s)
142 }
143 }
144 return out
145}
146
147func hasWildcard(origins []string) bool {
148 return slices.Contains(origins, "*")

Callers 1

CORSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected