CORS Configuration¶
Kiket uses dynamic CORS — allowed origins are read from ProductApplication.allowed_origins, not a static config file.
How It Works¶
- Browser sends request with
Originheader rack-corsmiddleware checks if the origin exists in any active ProductApplication'sallowed_originsarray- If matched, CORS headers are set (
Access-Control-Allow-Origin, etc.) - The
ProductIdentificationMiddlewarealso setsCurrent.product_applicationfrom the same Origin
Origins are cached for 5 minutes and automatically invalidated when a ProductApplication is saved or deleted.
Configuring Origins¶
Add origins when registering your product (via the admin panel or during setup). Include the protocol (https://). Each product can have multiple origins.
Example origins:
Development¶
In development and test environments, all origins are allowed — no configuration needed.
Debugging¶
If your frontend gets CORS errors:
- Check the
Originheader in browser DevTools (Network tab → request headers) - Verify the exact origin (including port) is in your product's
allowed_origins - Check the product is active (not inactive)
- Origins are cached for 5 minutes — changes take effect within that window
Exposed Headers¶
These headers are exposed to the browser via CORS:
X-Request-IdX-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset