   (POST "/problem/reject" [id]
     (reject-problem (Integer. id) "We didn't like your problem."))
   (POST "/problem/:id" [id code]
-    (static-run-code (Integer. id) code))
+    (static-run-code (Integer. id) (trim-code code)))
   (POST "/rest/problem/:id" [id code]
      {:headers {"Content-Type" "application/json"}}
-     (rest-run-code (Integer. id) code))
+     (rest-run-code (Integer. id) (trim-code code)))
   (GET "/problems/rss" [] (create-feed
                            "4Clojure: Recent Problems"
                            "http://4clojure.com/problems"

specified id.

Return a map, {:message, :url, :num-tests-passed}."
  [id raw-code]
  (try
    (let [code (.trim raw-code)
          {:keys [tests restricted] :as problem} (get-problem id)
          sb-tester (get-tester restricted)
          user-forms (s/join " " (map pr-str (read-string-safely code)))
          results (if (empty? user-forms)

  "Turn an integer into a key suitable for fetching from mongodb."
  [id]
  keyword str int)

(defn trim-code [code]
  (when code (.trim code)))

(defn code-length [code]
  (count (remove #(Character/isWhitespace %)
