MCPcopy Create free account
hub / github.com/cli/cli / ResourceHost

Function ResourceHost

pkg/cmd/event/shared/subscription.go:16–21  ·  view source on GitHub ↗

ResourceHost returns the host to send subscription requests for resourceURL to, or fallback when the URL names no host. The API validates the resource; its host only picks where to send the request.

(resourceURL, fallback string)

Source from the content-addressed store, hash-verified

14// ResourceHost returns the host to send subscription requests for resourceURL to, or fallback when the URL names no
15// host. The API validates the resource; its host only picks where to send the request.
16func ResourceHost(resourceURL, fallback string) string {
17 if u, err := url.Parse(resourceURL); err == nil && u.Host != "" {
18 return ghauth.NormalizeHostname(u.Hostname())
19 }
20 return fallback
21}
22
23// NormalizeEventTypes drops blank and duplicate event types, which the API rejects.
24func NormalizeEventTypes(names []string) []string {

Callers 2

createRunFunction · 0.92
listenRunFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected