Skip to content

Commit

Permalink
Delete tempfile
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Mar 20, 2015
1 parent e39bd68 commit 18319d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mini_file_server/core/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
(POST "/" {{{:keys [tempfile filename]} :file group :group} :params :as params}
(log/info (str "Receiving " (join group filename)))
(if (fs/store tempfile group filename)
(response {:url (url-for params group filename)})
(do
(.delete tempfile)
(response {:url (url-for params group filename)}))
{:status 400
:headers {"Content-Type" "text/plain"}
:body "Bad request"}))
Expand Down

0 comments on commit 18319d6

Please sign in to comment.