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

Function escapeManagementResponseBody

internal/pluginhost/management.go:343–349  ·  view source on GitHub ↗
(resp pluginapi.ManagementResponse)

Source from the content-addressed store, hash-verified

341}
342
343func escapeManagementResponseBody(resp pluginapi.ManagementResponse) []byte {
344 body, okEscaped := htmlsanitize.JSONBodyIfLikely(resp.Body, resp.Headers.Get("Content-Type"))
345 if !okEscaped {
346 return resp.Body
347 }
348 return body
349}
350
351func (h *Host) callResourceHandler(ctx context.Context, record resourceRouteRecord, req pluginapi.ManagementRequest) (resp pluginapi.ManagementResponse, err error) {
352 if h == nil || record.route.Handler == nil || h.isPluginFused(record.pluginID) || !h.pluginIdentityCurrent(record.pluginID, record.path, record.version) {

Callers 1

ServeManagementHTTPMethod · 0.85

Calls 2

JSONBodyIfLikelyFunction · 0.92
GetMethod · 0.45

Tested by

no test coverage detected