doc | ||
src/fuck_cors_app | ||
test/fuck_cors_app | ||
.gitignore | ||
LICENSE | ||
project.clj | ||
README.md |
fuck-cors-app
A Clojure Application to self host a CORS proxy.
As a webdev, or even for most usage, CORS are not a very protective measure. Here is a CORS proxy implemented in very few lines of clojure.
Usage
lein run
Then in your js code
// BEFORE
document.fetch(url) // => FAIL WITH CORS
// AFTER
document.fetch('http://127.0.0.1:1977/?url=' + encodeURIComponent(url)) // => WORKS
As simple as that.
License
Copyright © 2024 Yann Esposito
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.