   (set-header [x key value])
   (add-header [x key value]))
 
-(defn ^String get-character-encoding [headers]
+(defn ^:internal ^String get-character-encoding [headers]
   (or
     (when-let [type (get-value headers "content-type")]
       (second (re-find charset-pattern type)))
     default-encoding))
 
-(defn headers->map [headers]
+(defn ^:internal headers->map [headers]
   (persistent!
     (reduce
       (fn [accum ^String name]

      (transient {})
      (get-names headers))))

(defn write-headers
  [output, headers]
  (doseq [[^String k, v] headers]
    (if (coll? v)

;; See the License for the specific language governing permissions and
;; limitations under the License.

(ns ^:no-doc ^:internal
    immutant.web.internal.headers
  (:require [clojure.string :as str]))

;; borrowed from ring.util.request/charset-pattern, which appeared in ring 1.3.0.
(def ^:private charset-pattern
  #";(?:.*\s)?(?i:charset)=([!#$%&'*\-+.0-9A-Z\^_`a-z\|~]+|\"(\\\"|[^\"])*\")\s*(?:;|$)")

(def ^:private default-encoding "ISO-8859-1")

(defprotocol Headers
  (get-names [x])
