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

Function checkHost

internal/attachments/client.go:59–64  ·  view source on GitHub ↗

checkHost rejects a host that cannot serve the upload endpoint. IsEnterprise is false for ghe.com tenants, so data residency keeps working.

(host string)

Source from the content-addressed store, hash-verified

57// checkHost rejects a host that cannot serve the upload endpoint. IsEnterprise
58// is false for ghe.com tenants, so data residency keeps working.
59func checkHost(host string) error {
60 if auth.IsEnterprise(host) {
61 return errors.New("attaching files is not supported on GitHub Enterprise Server")
62 }
63 return nil
64}
65
66// uploadPermissions lists the repository permissions that can attach a file.
67// The list matches api.Repository.ViewerCanPush, and it is measured against the

Callers 2

TestCheckHostFunction · 0.85
NewUploaderFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestCheckHostFunction · 0.68