Skip to content

Commit f8f109c

Browse files
committed
anonymize
1 parent 97859a1 commit f8f109c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/http/oauth/oauth.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@ func (h *AuthHandler) handleProtectedResource(w http.ResponseWriter, r *http.Req
156156
}
157157

158158
// GetEffectiveResourcePath returns the resource path for OAuth protected resource URLs.
159-
// It checks for the X-GitHub-Original-Path header set by copilot-api (CAPI), which contains
159+
// It checks for the X-GitHub-Original-Path header set by GitHub, which contains
160160
// the exact path the client requested before the /mcp prefix was stripped.
161-
// If the header is not present (e.g., direct access or older CAPI versions), it falls back to
161+
// If the header is not present, it falls back to
162162
// restoring the /mcp prefix.
163163
func GetEffectiveResourcePath(r *http.Request) string {
164-
// Check for the original path header from copilot-api (preferred method)
164+
// Check for the original path header from GitHub (preferred method)
165165
if originalPath := r.Header.Get(headers.OriginalPathHeader); originalPath != "" {
166166
return originalPath
167167
}
168168

169-
// Fallback: copilot-api strips /mcp prefix, so we need to restore it for the external URL
169+
// Fallback: GitHub strips /mcp prefix, so we need to restore it for the external URL
170170
if r.URL.Path == "/" {
171171
return "/mcp"
172172
}

0 commit comments

Comments
 (0)