MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / encodeRequest

Function encodeRequest

internal/wsrelay/http.go:177–191  ·  view source on GitHub ↗
(req *HTTPRequest)

Source from the content-addressed store, hash-verified

175}
176
177func encodeRequest(req *HTTPRequest) map[string]any {
178 headers := make(map[string]any, len(req.Headers))
179 for key, values := range req.Headers {
180 copyValues := make([]string, len(values))
181 copy(copyValues, values)
182 headers[key] = copyValues
183 }
184 return map[string]any{
185 "method": req.Method,
186 "url": req.URL,
187 "headers": headers,
188 "body": string(req.Body),
189 "sent_at": time.Now().UTC().Format(time.RFC3339Nano),
190 }
191}
192
193func decodeResponse(payload map[string]any) *HTTPResponse {
194 if payload == nil {

Callers 2

NonStreamMethod · 0.85
StreamMethod · 0.85

Calls 1

FormatMethod · 0.80

Tested by

no test coverage detected