We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6fea0ef + 61488f8 commit 937dd4fCopy full SHA for 937dd4f
2 files changed
src/ring/util/codec.clj
@@ -142,7 +142,7 @@
142
(reduce
143
(fn [m param]
144
(if-let [[k v] (str/split param #"=" 2)]
145
- (assoc-conj m (form-decode-str k encoding) (form-decode-str v encoding))
+ (assoc-conj m (form-decode-str k encoding) (form-decode-str (or v "") encoding))
146
m))
147
{}
148
(str/split encoded #"&")))))
test/ring/util/test/codec.clj
@@ -62,6 +62,9 @@
62
"a=b&c=d" {"a" "b" "c" "d"}
63
"foo+bar" "foo bar"
64
"a=b+c" {"a" "b c"}
65
- "a=b%2Fc" {"a" "b/c"})
+ "a=b%2Fc" {"a" "b/c"}
66
+ "a=b&c" {"a" "b" "c" ""}
67
+ "a=&b=c" {"a" "" "b" "c"}
68
+ "a&b=c" {"a" "" "b" "c"})
69
(is (= (form-decode "a=foo%FE%FF%00%2Fbar" "UTF-16")
70
{"a" "foo/bar"})))
0 commit comments