Skip to content

Commit

Permalink
Add X-Frame-Options DENY in middleware.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Oct 18, 2013
1 parent 010123b commit 46ed59c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/clojars/web.clj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
(when (not (empty? password))
{:username user :password password})))))

(defn wrap-x-frame-options [f]
(fn [req] (update-in (f req) [:headers] assoc "X-Frame-Options" "DENY")))

(defroutes clojars-app
(context "/repo" _
(-> repo/routes
Expand All @@ -81,7 +84,8 @@
:workflows [(workflows/interactive-form)
registration/workflow]})
(wrap-anti-forgery)
(wrap-x-frame-options)
(wrap-exceptions)
(site)
(wrap-resource "public")
(wrap-file-info)))
(wrap-file-info)))

0 comments on commit 46ed59c

Please sign in to comment.