weavejester / compojure

A concise routing library for Ring/Clojure
Eclipse Public License 1.0
4.08k stars 259 forks source link

1.5.2 broke my files route #164

Open rpodgorny opened 7 years ago

rpodgorny commented 7 years ago

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

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

weavejester commented 7 years ago

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.

rpodgorny commented 7 years ago

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?

weavejester commented 7 years ago

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 :)

rpodgorny commented 7 years ago

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.