MCPcopy
hub / github.com/github/github-mcp-server / resolveResourcePath

Function resolveResourcePath

pkg/http/oauth/oauth.go:170–185  ·  view source on GitHub ↗

resolveResourcePath returns the externally visible resource path, restoring the configured base path when proxies strip it before forwarding.

(path, basePath string)

Source from the content-addressed store, hash-verified

168// resolveResourcePath returns the externally visible resource path,
169// restoring the configured base path when proxies strip it before forwarding.
170func resolveResourcePath(path, basePath string) string {
171 if path == "" {
172 path = "/"
173 }
174 base := normalizeBasePath(basePath)
175 if base == "" {
176 return path
177 }
178 if path == "/" {
179 return base
180 }
181 if path == base || strings.HasPrefix(path, base+"/") {
182 return path
183 }
184 return base + path
185}
186
187// ResolveResourcePath returns the externally visible resource path for a request.
188// Exported for use by middleware.

Callers 2

metadataHandlerMethod · 0.85
ResolveResourcePathFunction · 0.85

Calls 1

normalizeBasePathFunction · 0.85

Tested by

no test coverage detected