Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.*.sw*
*~
*.class
lib/
5 changes: 2 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(defproject com.twinql.clojure/clj-conneg "1.1.0"
(defproject com.twinql.clojure/clj-conneg "1.1.1-SNAPSHOT"
:description "Clojure content negotiation library."
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]])
:dependencies [[org.clojure/clojure "1.4.0"]])
6 changes: 3 additions & 3 deletions src/com/twinql/clojure/conneg.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

(ns com.twinql.clojure.conneg
(:refer-clojure)
(:require [clojure.contrib.str-utils :as str-utils]))
(:require [clojure.string :as string]))

(def accept-fragment-re
#"^(\*|[^()<>@,;:\"/\[\]?={} ]+)/(\*|[^()<>@,;:\"/\[\]?={} ]+)$")
Expand Down Expand Up @@ -66,7 +66,7 @@
weight to a format."

([f]
(let [parts (str-utils/re-split #"\s*;\s*" f)]
(let [parts (string/split f #"\s*;\s*")]
(when (not (empty? parts))
;; First part will be a type.
(let [type-str (first parts)
Expand All @@ -84,7 +84,7 @@
(defn sorted-accept [h]
(sort-by-q
(map accept-fragment
(str-utils/re-split #"\s*,\s*" h))))
(string/split h #"\s*,\s*"))))

(defn acceptable-type
"Compare two type pairs. If the pairing is acceptable,
Expand Down