MCPcopy Index your code
hub / github.com/ContentSquare/chproxy / getFullQuery

Function getFullQuery

utils.go:132–151  ·  view source on GitHub ↗

getFullQuery returns full query from req.

(req *http.Request)

Source from the content-addressed store, hash-verified

130
131// getFullQuery returns full query from req.
132func getFullQuery(req *http.Request) ([]byte, error) {
133 var result bytes.Buffer
134
135 if req.URL.Query().Get("query") != "" {
136 result.WriteString(req.URL.Query().Get("query"))
137 }
138
139 body, err := getFullQueryFromBody(req)
140 if err != nil {
141 return nil, err
142 }
143
144 if result.Len() != 0 && len(body) != 0 {
145 result.WriteByte('\n')
146 }
147
148 result.Write(body)
149
150 return result.Bytes(), nil
151}
152
153func getFullQueryFromBody(req *http.Request) ([]byte, error) {
154 if req.Body == nil {

Callers 4

shouldRespondFromCacheFunction · 0.85
TestGetFullQueryGzippedFunction · 0.85
TestDecompressionFunction · 0.85
fakeCHHandlerFunction · 0.85

Calls 3

getFullQueryFromBodyFunction · 0.85
GetMethod · 0.65
WriteMethod · 0.45

Tested by 3

TestGetFullQueryGzippedFunction · 0.68
TestDecompressionFunction · 0.68
fakeCHHandlerFunction · 0.68