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

Method getJSONStringArrayQuery

rest/handler.go:1284–1293  ·  view source on GitHub ↗
(param string)

Source from the content-addressed store, hash-verified

1282}
1283
1284func (h *handler) getJSONStringArrayQuery(param string) ([]string, error) {
1285 var strings []string
1286 value := h.getQuery(param)
1287 if value != "" {
1288 if err := base.JSONUnmarshal([]byte(value), &strings); err != nil {
1289 return nil, base.HTTPErrorf(http.StatusBadRequest, "%s URL param is not a JSON string array", param)
1290 }
1291 }
1292 return strings, nil
1293}
1294
1295func (h *handler) userAgentIs(agent string) bool {
1296 userAgent := h.rq.Header.Get(base.HTTPHeaderUserAgent)

Callers 2

handleGetDocMethod · 0.95
handleAllDocsMethod · 0.95

Calls 3

getQueryMethod · 0.95
JSONUnmarshalFunction · 0.92
HTTPErrorfFunction · 0.92

Tested by

no test coverage detected