fix: approximated not verifying domain, change request type for /agents

route
This commit is contained in:
Rotimi Best
2026-05-21 14:05:37 +01:00
parent c1bbd02f8e
commit ec92fc5083
23 changed files with 179 additions and 176 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ On the **dashboard** Render service:
| -------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `HOST_HEADER` | `x-forwarded-host` | SvelteKit adapter-node reads the effective host from this so `event.url.host` is the tenant/admin host the user is on. |
| `PROTOCOL_HEADER` | `x-forwarded-proto` | Same, for protocol. |
| `PRIVATE_APP_HOST` | `myclassroomio.com` | Used by `getSubdomain` in `layout-setup.ts` to extract the org siteName. |
| `PRIVATE_APP_HOST` | `myclassroomio.com` | Used by `getSubdomain` in `layout-setup.ts` to extract the org siteName. |
| `PUBLIC_SERVER_URL` | `https://api.classroomio.com` | Used at runtime only as a fallback / for `authClient`'s SSR-time URL constructor; browser code uses `${origin}/proxy` via `getRequestBaseUrl`. |
| `PRIVATE_SERVER_URL` | API's internal Render URL | Server-side dashboard → API calls bypass the public edge. |
+11
View File
@@ -0,0 +1,11 @@
/**
* Custom request `Content-Type` for `/agent/*` write endpoints.
*
* Render fronts every service with Cloudflare, which runs OWASP Managed Rules
* on bodies whose content-type substring-matches `application/json` and rejects
* AI chat payloads that contain SQL-injection-shaped strings (e.g. user
* messages discussing `SELECT … WHERE … OR 1=1`). A vendor-specific type
* falls through inspection. A small server middleware rewrites it back to
* `application/json` so `zValidator` parses the body unchanged.
*/
export const AGENT_CONTENT_TYPE = 'application/x-cio-agent';
+1
View File
@@ -3,3 +3,4 @@ export * from './org';
export * from './content';
export * from './domains';
export * from './error-codes';
export * from './agent';