New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

worked through ring-defaults incompatibilities with current app #13

Merged
merged 1 commit into from Oct 28, 2017
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+19 −19
Diff settings

Always

Just for now

Copy path View file
@@ -16,7 +16,7 @@
;;; ui
[hiccup "1.0.5"]
;;; middleware
[ring/ring-anti-forgery "1.1.0"]
[ring/ring-defaults "0.3.1"]
;;; hosted assests
[ring-webjars "0.2.0"]
[org.webjars/bootstrap "3.3.7-1"]
File renamed without changes.
Copy path View file
@@ -1,26 +1,26 @@
(ns listopia.core
(:require [listopia.item.middleware :as item.middleware]
[listopia.route :as route])
(:require [ring.adapter.jetty :as jetty]
[ring.middleware.reload :refer [wrap-reload]]
[ring.middleware.params :refer [wrap-params]]
[ring.middleware.resource :refer [wrap-resource]]
[ring.middleware.file-info :refer [wrap-file-info]]
[ring.middleware.session :refer [wrap-session]]
[ring.middleware.anti-forgery :refer [wrap-anti-forgery]]
[ring.middleware.webjars :refer [wrap-webjars]])
(:require [listopia.route :as route]
[listopia.middleware :as middleware])
(:require [ring.adapter.jetty :as jetty]
[ring.middleware.defaults :refer :all]
[ring.middleware.webjars :refer [wrap-webjars]]
[ring.middleware.reload :refer [wrap-reload]])
(:gen-class))


(def app
(-> route/combined-routes
wrap-anti-forgery ; csrf protection
wrap-session ; session data
wrap-params ; url-encoded param support
item.middleware/wrap-server ; set server name header
(wrap-resource "static") ; set static asset path
wrap-file-info ; add file info to static resources
wrap-webjars)) ; set asset path for webjar assets
;; wrap-defaults includes ring middleware in the correct order to provide:
;; csrf protection, session data, url parameters, static assets, and more
(wrap-defaults
(-> site-defaults
;; disabling content-type injection since we're returning a ring response
(assoc-in [:security :content-type-options] false)
(assoc-in [:responses :content-types] false)
;; handling this within the application
(assoc-in [:params :keywordize] false)))
wrap-webjars ; set path for webjar assets
middleware/wrap-server)) ; set server name header


(defn -main
@@ -1,4 +1,4 @@
(ns listopia.item.middleware)
(ns listopia.middleware)


;; example request modification
ProTip! Use n and p to navigate between commits in a pull request.