-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Conversation
f312b18
to
e6fa90d
Compare
There was a problem hiding this 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.
Great work, thank you! Love the new feedback for LLMs. |
Fixes issues in GHES when subdomain isolation is enabled.
PR introduces:
func newGHESHost(hostname string) (apiHost, error)
get_file_contents
to return better fallback messageCloses:
get_file_contents
is not working properly (Path did not point to a file or directory, but resolved git ref) #864