Permalink
Browse files

Hold off on ring.util.request for now.

  • Loading branch information...
1 parent d2b80a9 commit 5d9f873f163c7fee707f63b480d6a9ba959020fa @mmcgrana committed Feb 28, 2010
Showing with 0 additions and 43 deletions.
  1. +0 −1 README.md
  2. +0 −19 ring-core/src/ring/util/request.clj
  3. +0 −23 ring-core/test/ring/util/request_test.clj
View
1 README.md
@@ -62,7 +62,6 @@ To see a more sophisticated Ring app, run:
* `ring.middleware.cookies`: Manage browser cookies.
* `ring.middleware.session`: Manage user sessions. Memory and cookie session stores are available by default.
* `ring.util.response`: Generate Ring responses.
-* `ring.util.request`: Parse Ring requests.
### ring-devel
View
19 ring-core/src/ring/util/request.clj
@@ -1,19 +0,0 @@
-(ns ring.util.request)
-
-(defn ssl?
- "Returns true iff the request was submitted over SSL."
- [req]
- (= :https (:scheme req)))
-
-(defn server-host
- "Returns a String for the full hostname."
- [req]
- (let [hdrs (:headers req)]
- (or (get hdrs "x-forwarded-host")
- (get hdrs "host")
- (:server-name req))))
-
-(defn full-uri
- "Returns a String for the full request URI, including the protocol and host."
- [req]
- (str (name (:scheme req)) "://" (server-host req) (:uri req)))
View
23 ring-core/test/ring/util/request_test.clj
@@ -1,23 +0,0 @@
-(ns ring.util.request-test
- (:use clojure.test
- ring.util.request))
-
-(deftest test-ssl?
- (is (ssl? {:scheme :https}))
- (is (not (ssl? {:scheme :http}))))
-
-(deftest test-server-host
- (is (= "google.com"
- (server-host {:server-name "ask.com" :server-port 80
- :headers {"x-forwarded-host" "google.com"
- "host" "yahoo.com"}})))
- (is (= "yahoo.com"
- (server-host {:server-name "ask.com" :server-port 80
- :headers {"host" "yahoo.com"}})))
- (is (= "ask.com"
- (server-host {:server-name "ask.com" :server-port 80}))))
-
-(deftest test-full-uri
- (is (= "https://google.com/foo/bar"
- (full-uri {:uri "/foo/bar" :scheme :https
- :headers {"host" "google.com"}}))))

0 comments on commit 5d9f873

Please sign in to comment.