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

Sign up
Appearance settings

Fix subdomain isolation URL parsing #1218

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
tonytrg merged 6 commits into main from tonytrg/fix-subdomain
Oct 15, 2025
Merged

Fix subdomain isolation URL parsing #1218

tonytrg merged 6 commits into main from tonytrg/fix-subdomain
Oct 15, 2025

Conversation

@tonytrg
Copy link
Contributor

@tonytrg tonytrg commented Oct 14, 2025
edited
Loading

Fixes issues in GHES when subdomain isolation is enabled.

PR introduces:

  • raw api probe to detect subdomain isolation
    • changes url format for affected urls in func newGHESHost(hostname string) (apiHost, error)
  • changes the return message of get_file_contents to return better fallback message
    • better context for llm

Closes:

nasxisbest and rubensilvapipedrive reacted with thumbs up emoji nasxisbest, mgimenoromanadevinta, and alfredolopezzz reacted with hooray emoji nasxisbest, rubensilvapipedrive, mgimenoromanadevinta, and alfredolopezzz reacted with heart emoji nasxisbest and alfredolopezzz reacted with rocket emoji nasxisbest reacted with eyes emoji
@tonytrg tonytrg marked this pull request as ready for review October 14, 2025 15:26
@tonytrg tonytrg requested a review from a team as a code owner October 14, 2025 15:26
Copilot AI review requested due to automatic review settings October 14, 2025 15:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes URL parsing for GitHub Enterprise Server (GUES) instances with subdomain isolation enabled. The fix addresses issues where the server was incorrectly constructing URLs for raw content and upload APIs when subdomain isolation was configured.

  • Adds automatic detection of subdomain isolation by probing the raw subdomain endpoint
  • Updates URL construction logic to use subdomain-based URLs when isolation is detected
  • Improves error messages to provide better context when raw API calls fail

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/ghmcp/server.go Implements subdomain isolation detection and conditional URL formatting logic
pkg/github/repositories.go Captures raw API response codes and improves error messaging for better debugging context

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

nasxisbest commented Oct 14, 2025
edited
Loading

Great work, thank you! Love the new feedback for LLMs.

@tonytrg tonytrg merged commit 99acea6 into main Oct 15, 2025
16 checks passed
@tonytrg tonytrg deleted the tonytrg/fix-subdomain branch October 15, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

@omgitsads omgitsads omgitsads approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /