Created
July 18, 2013 22:13
-
-
Save cap10morgan/6033586 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 reproduce-body-params-bug.core | |
(:require [ring.middleware.format-params :refer [wrap-restful-params]] | |
[compojure.core :refer [routes POST]] | |
[compojure.handler :refer [api]])) | |
(defn handle-post [request] | |
{:status 200 | |
:headers {"Content-Type" "text/plain"} | |
:body (str (:body-params request))}) | |
(defn assemble-routes [] | |
(routes (POST "/" [] handle-post))) | |
(defn create-handler [] | |
(fn [request] | |
((-> (assemble-routes) | |
api | |
wrap-restful-params) | |
request))) | |
(defn handler | |
"Ring handler" | |
[request] | |
((create-handler) request)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment