From 096fd8fad5dfd83b75acbfcc8376e197cf83418c Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 14 Feb 2015 20:14:22 -0500 Subject: [PATCH] use a blank string for empty body instead of nil otherwise the string "null" ends up used as the response body --- src/clj_webtoolbox/response.clj | 2 +- src/clj_webtoolbox/response_helpers.clj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clj_webtoolbox/response.clj b/src/clj_webtoolbox/response.clj index 883e403..c800874 100644 --- a/src/clj_webtoolbox/response.clj +++ b/src/clj_webtoolbox/response.clj @@ -9,7 +9,7 @@ (def ^:private base-response {:status 200 :headers {} - :body nil}) + :body ""}) (defn content "Returns a Ring response where the body is set to the value given." diff --git a/src/clj_webtoolbox/response_helpers.clj b/src/clj_webtoolbox/response_helpers.clj index e2eba05..a55364a 100644 --- a/src/clj_webtoolbox/response_helpers.clj +++ b/src/clj_webtoolbox/response_helpers.clj @@ -3,7 +3,7 @@ [clj-webtoolbox.response :as response])) (defn- ->response [body status] - (-> (response/content body) + (-> (response/content (if (nil? body) "" body)) (response/status status))) (defn ok [& [body]] (->response body 200))