MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / bindableText

Function bindableText

internal/server/middleware_request_text.go:198–200  ·  view source on GitHub ↗

bindableText reports whether a decoded string can be bound into a text comparison. It is the shared predicate of both middlewares in this file: ValidatePath applies it to the decoded path, ValidateQuery to each decoded query key and value. The rule is derived from what the database refuses rather th

(s string)

Source from the content-addressed store, hash-verified

196// uniformly at the transport, so that a request cannot get one answer on
197// SQLite and another on Postgres — which is the actual defect being fixed.
198func bindableText(s string) bool {
199 return utf8.ValidString(s) && !strings.ContainsRune(s, 0)
200}
201
202// ValidateQuery is the query-string half of the same rule ValidatePath
203// applies to the path: reject a request whose DECODED query keys or values

Callers 11

assertQueryVectorIntactFunction · 0.85
ValidatePathFunction · 0.85
validQueryTextFunction · 0.85
TestTruncateBindableTextFunction · 0.85
TestBindableTextFunction · 0.85
parseArtifactRequestFunction · 0.85
multipartValuesFunction · 0.85

Calls

no outgoing calls