MCPcopy Create free account
hub / github.com/bytebase/bytebase / defaultAPIRequestSkipper

Function defaultAPIRequestSkipper

backend/server/server_frontend_routes.go:67–70  ·  view source on GitHub ↗

defaultAPIRequestSkipper is echo skipper for api requests. /bytebase.v1 covers Connect-go gRPC handlers so unknown gRPC paths return a structured 404 instead of falling through to the SPA's HTML5 fallback (which would return index.html).

(c *echo.Context)

Source from the content-addressed store, hash-verified

65// Connect-go gRPC handlers so unknown gRPC paths return a structured 404 instead
66// of falling through to the SPA's HTML5 fallback (which would return index.html).
67func defaultAPIRequestSkipper(c *echo.Context) bool {
68 path := c.Request().URL.Path
69 return common.HasPrefixes(path, "/api", "/v1", "/bytebase.v1", "/.well-known", webhookAPIPrefix)
70}

Callers 2

registerFrontendRoutesFunction · 0.85

Calls 1

HasPrefixesFunction · 0.92

Tested by 1