File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 126126 (form-decode-str encoded " UTF-8" ))
127127 ([^String encoded ^String encoding]
128128 (try
129- (URLDecoder/decode encoded encoding)
129+ (URLDecoder/decode encoded ^String ( or encoding " UTF-8 " ) )
130130 (catch Exception _ nil ))))
131131
132132(defn form-decode
Original file line number Diff line number Diff line change 5353
5454(deftest test-form-decode-str
5555 (is (= (form-decode-str " foo=bar+baz" ) " foo=bar baz" ))
56- (is (nil? (form-decode-str " %D" ))))
56+ (is (nil? (form-decode-str " %D" )))
57+ (is (= (form-decode-str " foo=bar+baz" nil ) " foo=bar baz" ))
58+ (is (= (form-decode-str " foo=bar+baz" " UTF-8" ) " foo=bar baz" )))
5759
5860(deftest test-form-decode
5961 (are [x y] (= (form-decode x) y)
7577 " a=%" {}
7678 " %=%" {}))
7779 (is (= (form-decode " a=foo%FE%FF%00%2Fbar" " UTF-16" )
80+ {" a" " foo/bar" }))
81+ (is (= (form-decode " a=foo%2Fbar" nil )
7882 {" a" " foo/bar" })))
You can’t perform that action at this time.
0 commit comments