wrap-resource captures root route when in a jar file #84

Closed
pjlegato opened this Issue Jul 30, 2014 · 2 comments

2 participants

@pjlegato

If wrap-resource is added to the handler stack ahead of Compojure routes meant to serve the root (index) route while running from a jar file, it will mistakenly identify the top resource directory as a file and return a zero-length result, preventing any inner handlers (such as Compojure routes) from serving the root path. This behavior does not occur when running from a source tree; everything works fine when not in a jar, with identical code.

This seems to be the same problem described at https://groups.google.com/forum/#!topic/ring-clojure/P6BU4xc7p-0 .

Possible fixes:

  • Don't serve any zero-length results from wrap-resource, as suggested in that thread.
  • Detect directories in some other way, and don't serve them
  • Don't serve the root route, at least, since requests for the root of a site are common and are never going to be correctly served by a zero-length reply.

I am happy to do the actual coding for the fix if the maintainers approve one of these strategies for incorporation into Ring.

@weavejester
Collaborator

This issue was raised on an inactive repository. Closing.

@weavejester weavejester closed this Dec 8, 2014
@pjlegato

Ah, I see. Re-opened at ring-clojure#175

Perhaps it would lessen confusion to delete this inactive repository? It also still beats the active repository in Google results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment