MCPcopy Index your code
hub / github.com/modelcontextprotocol/registry / containsNulByte

Function containsNulByte

internal/api/server.go:60–68  ·  view source on GitHub ↗

containsNulByte checks if a string contains a NUL byte, either as a literal \x00 or URL-encoded as %00.

(s string)

Source from the content-addressed store, hash-verified

58// containsNulByte checks if a string contains a NUL byte, either as a literal \x00
59// or URL-encoded as %00.
60func containsNulByte(s string) bool {
61 // Check for literal NUL byte
62 if strings.ContainsRune(s, '\x00') {
63 return true
64 }
65 // Check for URL-encoded NUL byte (%00)
66 // Using Contains directly since %00 has no case variation (both hex digits are 0)
67 return strings.Contains(s, "%00")
68}
69
70// TrailingSlashMiddleware redirects requests with trailing slashes to their canonical form
71func TrailingSlashMiddleware(next http.Handler) http.Handler {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…