MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / pathTemplateContains

Method pathTemplateContains

rest/handler.go:1836–1843  ·  view source on GitHub ↗

Checks whether the mux path template for the current route contains the specified pattern

(pattern string)

Source from the content-addressed store, hash-verified

1834
1835// Checks whether the mux path template for the current route contains the specified pattern
1836func (h *handler) pathTemplateContains(pattern string) bool {
1837 route := mux.CurrentRoute(h.rq)
1838 pathTemplate, err := route.GetPathTemplate()
1839 if err != nil {
1840 return false
1841 }
1842 return strings.Contains(pathTemplate, pattern)
1843}
1844
1845// getCORSConfig will return the CORS config for the handler's database if set, otherwise it will return the server CORS config
1846func (h *handler) getCORSConfig() *auth.CORSConfig {

Callers 1

isBlipSyncMethod · 0.95

Calls 1

ContainsMethod · 0.65

Tested by

no test coverage detected