mirror of
https://github.com/hanzoai/social.git
synced 2026-10-27 09:19:48 +00:00
The hostname still points at the static origin. The worker answers only the Postiz paths, with the same handler the process uses, so Grok can connect there while /v1/social stays the Hanzo API. Co-authored-by: z <[email protected]>
19 lines
704 B
JavaScript
19 lines
704 B
JavaScript
import assert from 'node:assert/strict'
|
|
import test from 'node:test'
|
|
|
|
import { handleEdgeRequest } from './edge.mjs'
|
|
|
|
test('the edge answers Postiz with JSON instead of the SPA', async () => {
|
|
const response = await handleEdgeRequest(
|
|
new Request('https://social.hanzo.ai/mcp', {
|
|
method: 'POST',
|
|
headers: { 'content-type': 'application/json', accept: 'application/json, text/event-stream' },
|
|
body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'tools/list' }),
|
|
}),
|
|
)
|
|
assert.equal(response.status, 401)
|
|
assert.match(response.headers.get('content-type'), /application\/json/)
|
|
const body = await response.json()
|
|
assert.match(body.message, /rejected this API key/)
|
|
})
|