File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 7
7
[parts.auth :as auth]
8
8
[reitit.ring.middleware.exception :as exception]
9
9
[ring.middleware.anti-forgery :refer [wrap-anti-forgery]]
10
+ [ring.middleware.content-type :refer [wrap-content-type]]
10
11
[ring.middleware.defaults :refer [api-defaults wrap-defaults site-defaults]]
11
12
[ring.middleware.resource :refer [wrap-resource]]
12
13
[ring.util.response :as response])
152
153
(assoc-in [:security :xss-protection ] {:mode :block }))))
153
154
154
155
(defn wrap-core-middlewares
155
- " Apply essential Ring middleware for the entire application. Currently, this
156
- is only `wrap-resources`, which allows to download static files from
157
- resources/public."
156
+ " Apply essential Ring middleware for the entire application.
157
+ - `wrap-resource`: Serves static files from resources/public
158
+ - `wrap-content-type`: Sets proper MIME types based on file extensions,
159
+ ensuring SVG files are served as image/svg+xml instead of text/plain"
158
160
[handler]
159
161
(-> handler
160
- (wrap-resource " public" )))
162
+ (wrap-resource " public" )
163
+ (wrap-content-type )))
161
164
162
165
(defn wrap-html-response
163
166
" Middleware for properly formatting HTML responses.
You can’t perform that action at this time.
0 commit comments