ring-clojure / ring-defaults

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

Issue on jboss wildfly; immutant issues with root path #12

Closed devasiajoseph closed 9 years ago

devasiajoseph commented 9 years ago

After deploying to wildfly, the root path "localhost:8080/app-name/" results in downloading of an empty file instead of loading the page, when ring-defaults are used.

Every other path seems to work.

Any guesses on which setting could be creating this issue?

I am creating the war using lein-immutant plugin.

weavejester commented 9 years ago

This might have something to do with ring-clojure/ring#184, but you haven't provided much information. My guess is that it might be the :static :resources option.

devasiajoseph commented 9 years ago

Thanks for replying.

I am testing this with luminus template

In the app handler I have a middleware like this https://gist.github.com/devasiajoseph/500a0b8c6ecdf72ae59c .

While I was trying to detect the issue (trial and error), I removed (wrap-defaults (assoc-in site-defaults [:session :store] (memory-store session/mem))) and it seems to be working. So I assumed it has something to do with ring-defaults.

I will check the mentioned issue and try to see if that is related or change the settings to see if that helps.

Thank you

devasiajoseph commented 9 years ago

In ring defaults commenting out:

(wrap wrap-resource (get-in config [:static :resources] false))

seems to fix the problem. So like you said probably that is where the issue is. Dunno how to fix it yet.

weavejester commented 9 years ago

You don't need to comment it out. You can just set your :static :resources configuration value to false.

devasiajoseph commented 9 years ago

It seems to be working when set to false. What am I gonna miss if I set it to false instead of the site-default "public"? Because right now I can't see any functional change when I am setting it to false.

weavejester commented 9 years ago

It depends on whether you have any static resources, or whether you're using an alternative way of delivering static resources, like the compojure.route/resources function.

devasiajoseph commented 9 years ago

Thank you!