Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Revise isGhes logic #963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Revise isGhes logic
  • Loading branch information
jww3 authored Oct 18, 2024
commit 0beadebc68cdae8a58b2cb3cbf5bf0d0020ba6fc
8 changes: 7 additions & 1 deletion 8 src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ export function isGhes(): boolean {
const ghUrl = new URL(
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
);
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';

const hostname = ghUrl.hostname.trimEnd().toUpperCase()
const isGitHubHost = hostname === 'GITHUB.COM'
const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM')
const isLocalHost = hostname.endsWith('.LOCALHOST')

return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost
}

export function isCacheFeatureAvailable(): boolean {
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.