Permalink
Browse files

Added ring.util.request namespace and header-seq func

  • Loading branch information...
1 parent 9adf1e6 commit 1cfb9711b0af47ef4032a24ef51e557a45eca9d2 @weavejester weavejester committed Jan 14, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 ring-core/src/ring/util/request.clj
View
10 ring-core/src/ring/util/request.clj
@@ -0,0 +1,10 @@
+(ns ring.util.request
+ "Parse and interpret Ring requests"
+ (:require [clojure.string :as str]))
+
+(defn header-seq
+ "Returns seq of values for the specified header. Multiple values can be
+ encoded in one header key using a comma as a separator."
+ [request key]
+ (-> (get-in request [:headers (name key)])
+ (str/split #"\s*,\s*")))

0 comments on commit 1cfb971

Please sign in to comment.