isTrusted checks if a URI's host matches any of the trusted hosts patterns.
(uri string)
| 274 | |
| 275 | // isTrusted checks if a URI's host matches any of the trusted hosts patterns. |
| 276 | func (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 | |
| 292 | func (r *Reader) include(ctx context.Context, node Node) error { |
| 293 | // Create a new vertex for the Taskfile |
no outgoing calls
no test coverage detected