MCPcopy
hub / github.com/go-task/task / isTrusted

Method isTrusted

taskfile/reader.go:276–290  ·  view source on GitHub ↗

isTrusted checks if a URI's host matches any of the trusted hosts patterns.

(uri string)

Source from the content-addressed store, hash-verified

274
275// isTrusted checks if a URI's host matches any of the trusted hosts patterns.
276func (r *Reader) isTrusted(uri string) bool {
277 if len(r.trustedHosts) == 0 {
278 return false
279 }
280
281 // Parse the URI to extract the host
282 parsedURL, err := url.Parse(uri)
283 if err != nil {
284 return false
285 }
286 host := parsedURL.Host
287
288 // Check against each trusted pattern (exact match including port if provided)
289 return slices.Contains(r.trustedHosts, host)
290}
291
292func (r *Reader) include(ctx context.Context, node Node) error {
293 // Create a new vertex for the Taskfile

Callers 1

readRemoteNodeContentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected