-
-
Save mccraigmccraig/65748e21995b37549ccc72fe6e1daca9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns er-model.util.mime | |
(:require | |
[clojure.string :as str])) | |
(defn parse-content-type | |
[ct] | |
(let [[content-type & params] (str/split ct #"\s*;\s*") | |
param-name-vals (for [p params] | |
(let [[n v] (str/split p #"\s*=\s*")] | |
[(keyword n) v])) | |
params (into {} param-name-vals)] | |
[content-type params])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment