MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / pluginStoreURLMatchesAuthRule

Function pluginStoreURLMatchesAuthRule

internal/pluginstore/auth.go:206–219  ·  view source on GitHub ↗
(requestURL string, matchURL string)

Source from the content-addressed store, hash-verified

204}
205
206func pluginStoreURLMatchesAuthRule(requestURL string, matchURL string) bool {
207 request, errRequest := url.Parse(strings.TrimSpace(requestURL))
208 if errRequest != nil || request.Scheme == "" || request.Host == "" {
209 return false
210 }
211 rule, errRule := url.Parse(strings.TrimSpace(matchURL))
212 if errRule != nil || rule.Scheme == "" || rule.Host == "" {
213 return false
214 }
215 if !strings.EqualFold(request.Scheme, rule.Scheme) || !strings.EqualFold(request.Host, rule.Host) {
216 return false
217 }
218 return pluginStorePathMatchesAuthRule(request.Path, rule.Path)
219}
220
221func pluginStorePathMatchesAuthRule(requestPath string, rulePath string) bool {
222 if rulePath == "" || rulePath == "/" {

Callers 1

matchingAuthConfigFunction · 0.85

Calls 1

Tested by

no test coverage detected