Describe the bug
Currently, any hostname ending with "github.com" (such as "slack-github.mirrors.m2d.in") is incorrectly identified as the public GitHub host github.com.
The fix changes the public github hostname check from a suffix match to an exact match:
Before: strings.HasSuffix(u.Hostname(), "github.com")
After: u.Hostname() == "github.com"
This ensures that GHES hostnames like "slack-github.mirrors.m2d.in" are correctly identified as GitHub Enterprise Server instances rather than being treated as the public github.com.
Alternative approaches:
- I am not sure if public github hosts can have subdomains, but if needed a regex can be used to match host name patterns.
- Add extra optional parameter like
IS_GHES to explicitly indicate that this is a GHES instance.
Fixes #662
Describe the bug
Currently, any hostname ending with "github.com" (such as "slack-github.mirrors.m2d.in") is incorrectly identified as the public GitHub host
github.mirrors.m2d.in.The fix changes the public github hostname check from a suffix match to an exact match:
Before: strings.HasSuffix(u.Hostname(), "github.com")
After: u.Hostname() == "github.com"
This ensures that GHES hostnames like "slack-github.mirrors.m2d.in" are correctly identified as GitHub Enterprise Server instances rather than being treated as the public github.com.
Alternative approaches:
IS_GHESto explicitly indicate that this is a GHES instance.Fixes #662