diff --git a/README.md b/README.md index d403507..454fe42 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,9 @@ Then ~~~ And use `wrap-open-cors` as middleware. +Now you can make AJAX call from _any_ website. -## Limitations - -There is a bug with Safari. -The only way to make it works is by using a _very_ dirty trick: - - +Of course if you want more control over which website are able to call your API, you should not use this middleware. ## License diff --git a/test/fuck_cors/core_test.clj b/test/fuck_cors/core_test.clj index 3584aa8..24a8b23 100644 --- a/test/fuck_cors/core_test.clj +++ b/test/fuck_cors/core_test.clj @@ -2,6 +2,11 @@ (:require [clojure.test :refer :all] [fuck-cors.core :refer :all])) -(deftest a-test - (testing "FIXME, I fail." - (is (= 0 1)))) +(def host-from-req (ns-resolve 'fuck-cors.core 'host-from-req)) + +(deftest test-host-from-req + (testing "Test the get host from request" + (let [request {:headers {"host" "yannesposito.com"} + :scheme :http}] + (is (= "http://yannesposito.com" + (host-from-req request))))))