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)
| 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. |
| 198 | func 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 |
no outgoing calls