mirror of
https://github.com/djdevin/recflare.git
synced 2026-10-27 07:58:55 -07:00
[studio] beta studio (#114)
* rrs stuff * studio service yay * rrs whitelist * moree studiooooooo fellowwww * rec room studio room loading yay * fixes yay * fix 2 because idk yayuh * Update cdn.app.ts * ccontent length fix? * Preserve content-length and upgrade metadata Return a real zero-filled byte array for CDN HEAD responses so the runtime preserves Content-Length while still sending no payload. In notify, re-create the Request with its original headers, set OWNER_HEADER from the validated token, and forward that Request to hub.fetch to avoid losing WebSocket upgrade metadata (which could trigger 500s in Durable Objects). These changes ensure the editor's size checks and WebSocket upgrades remain reliable. * fix x524234 * shirt thing? * [auth] remove grant table as we already have audit_log for now * rename table to generic device_grant * cleanup/lint --------- Co-authored-by: Devin Zuczek <devin.zuczek@gmail.com>
This commit is contained in:
@@ -266,14 +266,18 @@ const app = new Hono<App>()
|
||||
// entirely rather than letting them sit there collecting broadcasts.
|
||||
if (playerId === null) return c.json({ error: 'Unauthorized' }, 401)
|
||||
|
||||
const request = new Request(c.req.raw)
|
||||
const request = new Request(c.req.raw, {
|
||||
headers: new Headers(c.req.raw.headers),
|
||||
})
|
||||
// Always set from the validated token, never passed through: the header is the
|
||||
// DO's proof of identity, so a client sending its own must not be believed.
|
||||
request.headers.set(OWNER_HEADER, String(playerId))
|
||||
|
||||
// The upgrade is retried too: it is a bodyless GET, so re-issuing it is free, and a
|
||||
// reset here would otherwise fail the client's connect outright.
|
||||
return hubCall(c, (hub) => hub.fetch(new Request(request)))
|
||||
// reset here would otherwise fail the client's connect outright. Preserve the
|
||||
// original upgrade request rather than re-wrapping an already-upgraded Request,
|
||||
// which can lose the WebSocket upgrade metadata and trigger a 500 in the DO.
|
||||
return hubCall(c, (hub) => hub.fetch(request))
|
||||
})
|
||||
|
||||
// ---- Internal service-to-service send/broadcast --------------------------
|
||||
|
||||
Reference in New Issue
Block a user