Skip to content

scrubBody

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/ui-core/src/components/api-explorer/permalink.ts

A request body, minus anything credential-shaped.

A JSON body is walked so that {"email":…, "password":…} on a login operation loses only the password. A body that is NOT JSON cannot be walked, so it travels only when nothing in it looks like a credential — the conservative direction, because the alternative is putting a reader's token into a link they are about to paste into a chat room.

Signature

ts
function scrubBody(body: string | undefined, secrets: string[]): string | undefined

Parameters

NameType
body`string
secretsstring[]

Returns: string | undefined

Was this page helpful?

Download as PDF