MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / InjectQuery

Function InjectQuery

pkg/utils/url.go:7–21  ·  view source on GitHub ↗
(raw string, query url.Values)

Source from the content-addressed store, hash-verified

5)
6
7func InjectQuery(raw string, query url.Values) (string, error) {
8 param := query.Encode()
9 if param == "" {
10 return raw, nil
11 }
12 u, err := url.Parse(raw)
13 if err != nil {
14 return "", err
15 }
16 joiner := "?"
17 if u.RawQuery != "" {
18 joiner = "&"
19 }
20 return raw + joiner + param, nil
21}

Callers 2

redirectFunction · 0.92
proxyFunction · 0.92

Calls 1

EncodeMethod · 0.45

Tested by

no test coverage detected