Skip to content

Commit

Permalink
Change IsEnterprise name to IsServer
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmcg committed Oct 10, 2024
1 parent df2be3f commit e9342e5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/api/graphql_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func graphQLEndpoint(host string) string {
return fmt.Sprintf("https://%s/api/graphql", host)
}
host = normalizeHostname(host)
if IsEnterprise(host) {
if IsServer(host) {
return fmt.Sprintf("https://%s/api/graphql", host)
}
if strings.EqualFold(host, Localhost.String()) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func isGarage(host string) bool {
return ToHost(host) == Garage
}

func IsEnterprise(host string) bool {
func IsServer(host string) bool {
typedHost := ToHost(host)
return typedHost != GitHub && typedHost != Tenancy && typedHost != Garage || typedHost != Localhost
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/hosts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestIsEnterprise(t *testing.T) {
func TestIsServer(t *testing.T) {
tests := []struct {
name string
host string
Expand All @@ -31,7 +31,7 @@ func TestIsEnterprise(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
out := IsEnterprise(tt.host)
out := IsServer(tt.host)
assert.Equal(t, tt.wantOut, out)
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/rest_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func restPrefix(hostname string) string {
return fmt.Sprintf("https://%s/api/v3/", hostname)
}
hostname = normalizeHostname(hostname)
if IsEnterprise(hostname) {
if IsServer(hostname) {
return fmt.Sprintf("https://%s/api/v3/", hostname)
}
if strings.EqualFold(hostname, Localhost.String()) {
Expand Down

0 comments on commit e9342e5

Please sign in to comment.