mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
section 4: Phase 4: One streaming proxy forwarder used by both proxy ro
This commit is contained in:
1 parent
680a336a24
commit
2b00825b0a
5 files changed
+270
-53
No files matched your search
@@ -323,6 +323,18 @@ describe('opencode-proxy routes', () => {
|
||||
expect(body.error).toBe('Proxy request failed')
|
||||
})
|
||||
|
||||
it('returns a null body for bodyless upstream statuses', async () => {
|
||||
const upstreamFetch = vi.fn().mockResolvedValue(new Response(null, { status: 204 }))
|
||||
globalThis.fetch = upstreamFetch as unknown as typeof fetch
|
||||
|
||||
const res = await app.request('/api/opencode-proxy/doc', {
|
||||
headers: { Authorization: 'Bearer test-internal-token' },
|
||||
})
|
||||
|
||||
expect(res.status).toBe(204)
|
||||
expect(await res.text()).toBe('')
|
||||
})
|
||||
|
||||
it('preserves query string in upstream URL', async () => {
|
||||
const upstreamFetch = vi.fn().mockResolvedValue(
|
||||
new Response('ok', { status: 200, headers: { 'content-type': 'text/plain' } })
|
||||
|
||||
Reference in new issue
Block a user