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

Method PathVar

rest/handler.go:1235–1245  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

1233}
1234
1235func (h *handler) PathVar(name string) string {
1236 v := mux.Vars(h.rq)[name]
1237
1238 // Escape special chars i.e. '+' otherwise they are removed by QueryUnescape()
1239 v = strings.Replace(v, "+", "%2B", -1)
1240
1241 // Before routing the URL we explicitly disabled expansion of %-escapes in the path
1242 // (see function FixQuotedSlashes). So we have to unescape them now.
1243 v, _ = url.QueryUnescape(v)
1244 return v
1245}
1246
1247func (h *handler) SetPathVar(name string, value string) {
1248 mux.Vars(h.rq)[name] = url.QueryEscape(value)

Callers 15

handleGetDocChannelsMethod · 0.95
handleCreateTargetMethod · 0.95
handleProfilingMethod · 0.95
handleCreateDBMethod · 0.95
handlePutDbConfigMethod · 0.95
handleDeleteDBMethod · 0.95
handleGetRawDocMethod · 0.95
handleGetRevTreeMethod · 0.95
getOIDCCallbackURLMethod · 0.95
handleGetDocMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected