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

Function LooksLikeJSON

internal/htmlsanitize/htmlsanitize.go:94–100  ·  view source on GitHub ↗

LooksLikeJSON reports whether body starts with an object or array JSON marker.

(body []byte)

Source from the content-addressed store, hash-verified

92
93// LooksLikeJSON reports whether body starts with an object or array JSON marker.
94func LooksLikeJSON(body []byte) bool {
95 trimmed := bytes.TrimSpace(body)
96 if len(trimmed) == 0 {
97 return false
98 }
99 return trimmed[0] == '{' || trimmed[0] == '['
100}

Callers 1

JSONBodyIfLikelyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected