Skip to content

Allow use of non form-encoded payload #27

@rukor

Description

@rukor

At the moment, it always tries to make the request entity part of the base string irrespective of the content-type; this obviously run into issues when it tries to parse the body. So I changed parse-body-params to:

(defn parse-body-params
  "Parse the body of `request` as an URL encoded parameter list."
  [request]
  (let [body (to-str (:body request))]
    (if (and (= x-www-form-urlencoded (:content-type request))
             (not (blank? body)))
      (-> (apply hash-map (split body #"[=&]"))
          (transform-values url-decode))
      {})))

I can send a pull request if you prefer.

Thanks,
R

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions