ring-clojure / ring-defaults

A library to provide sensible Ring middleware defaults
MIT License
343 stars 32 forks source link

Not possible to :allow-symlinks? when setting :static :resources #27

Closed RickMoynihan closed 1 year ago

RickMoynihan commented 5 years ago

It seems that this option and others such as :loader and :prefer-handler? are not configurable via defaults.

This is also an issue when attempting to configure via duct.

tomconnors commented 5 years ago

I hit the same issue. For a gross short term fix I did:

(let [orig-wrap-resource ring.middleware.resource/wrap-resource]
  (with-redefs [ring.middleware.resource/wrap-resource
                (fn [h root]
                  (orig-wrap-resource h root {:allow-symlinks? true}))]
    (wrap-defaults handler site-defaults)))