@pramen/server 0.0.27 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/worker.js CHANGED
@@ -55,6 +55,9 @@ function corsHeaders(origin, env) {
55
55
  "access-control-allow-origin": allow.includes("*") ? "*" : origin,
56
56
  "access-control-allow-methods": "GET, POST, OPTIONS",
57
57
  "access-control-allow-headers": "content-type, authorization, x-pramen-tenant, x-pramen-store, x-pramen-d1-bookmark",
58
+ // Cache the preflight so a browser doesn't re-OPTIONS every /rpc/<name> path. 7200s is
59
+ // Chrome's cap; without it each RPC pays an extra round trip after the ~5s default.
60
+ "access-control-max-age": "7200",
58
61
  // Expose the D1 read-your-writes bookmark so a browser client can read it off the
59
62
  // response and carry it forward on the next request.
60
63
  "access-control-expose-headers": "x-pramen-d1-bookmark",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pramen/server",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "pramen server runtime — schema, ACL, ORM, live queries, files, and the createPramen(app) factory for Cloudflare Workers + Durable Objects.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/worker.ts CHANGED
@@ -108,6 +108,9 @@ function corsHeaders(origin: string | null, env: Env): Record<string, string> {
108
108
  "access-control-allow-origin": allow.includes("*") ? "*" : origin,
109
109
  "access-control-allow-methods": "GET, POST, OPTIONS",
110
110
  "access-control-allow-headers": "content-type, authorization, x-pramen-tenant, x-pramen-store, x-pramen-d1-bookmark",
111
+ // Cache the preflight so a browser doesn't re-OPTIONS every /rpc/<name> path. 7200s is
112
+ // Chrome's cap; without it each RPC pays an extra round trip after the ~5s default.
113
+ "access-control-max-age": "7200",
111
114
  // Expose the D1 read-your-writes bookmark so a browser client can read it off the
112
115
  // response and carry it forward on the next request.
113
116
  "access-control-expose-headers": "x-pramen-d1-bookmark",