MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isFormEncoded

Function isFormEncoded

packages/core/sdk/src/oauth-helpers.ts:549–550  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

547/** `a=b&c=d` — no whitespace, at least one `key=`. Deliberately strict: a prose
548 * body like `route not found` must NOT be mistaken for one field. */
549const isFormEncoded = (body: string): boolean =>
550 /^[^=&\s]+=[^&\s]*(?:&[^=&\s]+=[^&\s]*)*$/.test(body);
551
552const tokenEndpointHttpSummary = async (response: Response): Promise<string> => {
553 const status = `HTTP ${response.status}${response.statusText ? ` ${response.statusText}` : ""}`;

Callers 1

redactTokenEndpointBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected