Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clothesline/request_handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
(defn no-handler-found [req]
"Returns a 404 when no appropriate handler was found"
(-> (response "404 - Resource Not found")
(content-type "text-plain")
(content-type "text/plain")
(status 404)))

(defn- match-route [req route handler]
Expand Down
10 changes: 10 additions & 0 deletions test/clothesline/test/request_handler.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(ns clothesline.test.request-handler
(:use clojure.test)
(:require [clothesline.request-handler :as rh]
[clothesline.test.test-helpers :as test]))

(deftest no-handler-found
(let [response (rh/no-handler-found (test/make-request))]
(is (= 404 (:status response)))
;; this was broken, so enforce a legal content-type.
(is (re-find #"^[^/]+/[^/]+$" (get-in response [:headers "Content-Type"])))))