Skip to content

Commit a0f92e9

Browse files
Sync public snapshot from freebuff-private
Source: CodebuffAI/freebuff-private@04c30f9c322364fb2bf3036212be32dc40245b76
1 parent 053a38c commit a0f92e9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎common/src/util/mirror-request.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Buffer } from 'node:buffer'
2+
3+
/** Chat text is data, but Render's WAF can mistake it for executable commands.
4+
* The mirror server unwraps this UTF-8 JSON envelope after authentication.
5+
* This is transport encoding, not encryption. Deploy the decoder first. */
6+
export function encodeMirrorRequest(body: unknown): string {
7+
return JSON.stringify({
8+
encoding: 'base64',
9+
data: Buffer.from(JSON.stringify(body), 'utf8').toString('base64'),
10+
})
11+
}

0 commit comments

Comments
 (0)