Permalink
Browse files

Remove basic auth from production server. Closes #12.

  • Loading branch information...
1 parent 015b44f commit 9a297ffafe6cc9ea9e8fbe34c5b5d0f1a69d63cb Brenton Ashworth and Craig Andera committed Jan 10, 2012
Showing with 1 addition and 14 deletions.
  1. +1 −14 src/app/clj/one/sample/prod_server.clj
View
15 src/app/clj/one/sample/prod_server.clj
@@ -11,24 +11,11 @@
(def ^:private root "out/public")
-(defn- wrap-require-auth
- [app]
- (fn [req]
- (let [denied-response {:headers {"WWW-Authenticate" "Basic realm=\"Restricted\""}
- :body "HTTP authentication required."
- :status 401}]
- (if-let [auth ((:headers req) "authorization")]
- (if (= auth "Basic Y3Nzazppc2F3ZXNvbWU=") ;; username=cssk,password=isawesome
- (app req)
- denied-response)
- denied-response))))
-
(defroutes app-routes
remote-routes
(-> (ANY "*" request (file-response "404.html" {:root root}))
(wrap-file root)
- wrap-file-info
- wrap-require-auth))
+ wrap-file-info))
(def ^:private app (-> app-routes
wrap-params))

0 comments on commit 9a297ff

Please sign in to comment.