diff --git a/project.clj b/project.clj index c488b56..4fd1327 100644 --- a/project.clj +++ b/project.clj @@ -9,4 +9,5 @@ [ring/ring-core "1.11.0"] [ring/ring-jetty-adapter "1.11.0"] ] :main "fuck-cors-app.core" + :aot :all :repl-options {:init-ns fuck-cors-app.core}) diff --git a/src/fuck_cors_app/core.clj b/src/fuck_cors_app/core.clj index 348be72..378ffdf 100644 --- a/src/fuck_cors_app/core.clj +++ b/src/fuck_cors_app/core.clj @@ -8,9 +8,12 @@ (defn handler [request] - (let [url (get-in request [:query-params "url"])] + (if-let [url (get-in request [:query-params "url"])] (client/request {:request-method (:request-method request) - :url url}))) + :url url}) + {:status 200 + :headers {"Content-Type" "text/plain; charset=utf-8"} + :body "Let's bypass CORS ok?"})) (defn -main [& _args]