Data URI Generator
Turn text, SVG or a small file into a data: URI you can inline anywhere.
Generate correct CORS headers, and understand why the request was blocked.
The CORS Header Generator produces the headers your server needs and explains what the browser will then permit — including the credentials rule and the preflight response that catch almost everyone out.
CORS is a browser restriction, not a server one, and almost every confusing thing about it follows from that. This generates the headers your server needs to send, with each one explained in terms of what the browser will then permit.
The rules that catch people are handled explicitly. A wildcard origin cannot be combined with credentials — browsers reject it — so if you need cookies you must echo a specific origin and add Vary: Origin so caches do not serve the wrong one. A preflight OPTIONS request must be answered before the real request is sent, and must list the methods and headers you allow. Response headers your JavaScript needs to read must be named in Access-Control-Expose-Headers, or they are invisible even though they arrived.
A wildcard origin cannot be combined with credentials, and the generator refuses the combination rather than producing a header browsers will reject.
When a specific origin is echoed, the Vary header comes with it — without which a cache will serve one origin’s response to another.
The OPTIONS response is generated too, since a missing preflight answer means the real request is never sent.
Why your JavaScript cannot read a header that clearly arrived, and which directive fixes it.
Apache, nginx, Express and Laravel snippets, not just a list of header names.
A wildcard for a public API, or specific origins when credentials are involved.
What the preflight response should permit for the real request.
Cookies and Authorization headers need this on, which rules out the wildcard.
Apache, nginx, Express, Laravel and a raw header list are all generated.
Because you are also sending credentials. Access-Control-Allow-Origin: * and Access-Control-Allow-Credentials: true cannot be combined — echo the specific requesting origin instead and add Vary: Origin.
An automatic OPTIONS request the browser sends before anything that is not a simple GET or POST. If your server does not answer it with the right headers, the real request is never sent at all.
Because only a handful are exposed by default. Any other header must be named in Access-Control-Expose-Headers, or it arrives but stays invisible to your code.
No. It restricts what a browser lets one site do to another. curl, a server and a mobile app ignore it entirely. Authentication and authorisation are what protect an API.
What people who use the CORS Header Generator think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the CORS Header Generator. It takes half a minute and no account.
Write the first reviewTurn text, SVG or a small file into a data: URI you can inline anywhere.
Check YAML parses and find the line where the indentation goes wrong.
The full ASCII table with decimal, hex, octal, binary and HTML entities.
Draw an easing curve and see it against the standard ones.
Collapse a SQL query to one line and strip its comments.
Convert between px, rem, em, pt, %, vw and vh with the right context.
Run XPath expressions against your own XML and see every node that matches.
Compare two semantic versions and test them against a range.