compojure icon indicating copy to clipboard operation
compojure copied to clipboard

1.5.2 broke my files route

Open rpodgorny opened this issue 8 years ago • 4 comments

(route/files "/raw" {:root "/"})

...this works for me with 1.5.1 but returns "not found" for the same path in 1.5.2.

rpodgorny avatar Apr 04 '17 01:04 rpodgorny

You're serving files from your root path?

Compojure 1.5.2 just updated Ring to fix a directory traversal bug, so I suspect you're running into the consequences of that. Do you have any symlinks on your path? You might need to add the :allow-symlinks? true option to your option map.

weavejester avatar Apr 04 '17 02:04 weavejester

yes, i am. this is just for testing purposes - i'm a complete clojure beginner just playing and discovering.

adding :allow-symlinks indeed fixed the issue but in my case, no symlinks are involved - maybe a bug?

rpodgorny avatar Apr 04 '17 08:04 rpodgorny

It might be an issue specific to the root path. My guess is that if you tried any other :root, it would work fine.

If this is a bug related to the root path, it's something that will be fixed eventually, but as I'm sure you can appreciate, not exactly high priority since most of the time we don't want to serve files from the root :)

weavejester avatar Apr 04 '17 12:04 weavejester

yeah, that's possible. i'm just reporting because this is a breaking change which imho should not happen for .patch version release... ;-)

i totally understand the priority.

rpodgorny avatar Apr 05 '17 07:04 rpodgorny