akka-http/spray FileAndResourceDirectives.getFromResource with sub directories

62 views
Skip to first unread message

Martin Jöhren

unread,
May 13, 2015, 2:34:44 AM5/13/15
to akka...@googlegroups.com
Hi,

I'm using getFromResource to deliver html,pics and javascript from a directory which has multiple sub directories. That works fine except the case, that when using a url which maps on a sub directory the file listing of the directory will be shown. As far as I can see the code is trying to avoid that when the url ends with a '/' but without the slash it just returns a list of all the files.
I don't want to reject every path directly so I was wondering whether it makes sense to check inside the method whether it's a directory and if so, just reject the request. I could provide a PR for that when that does not break anything else?

Best

Martin

Roland Kuhn

unread,
May 13, 2015, 3:05:18 AM5/13/15
to akka-user
Hi Martin,

this sounds like a useful addition, please check if the ticket already exists and your PR would be most welcome!

Regards,

Roland

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


Martin Jöhren

unread,
May 13, 2015, 3:53:21 PM5/13/15
to akka...@googlegroups.com
Hi Roland,

I haven't found an issue for it so I go for the PR. Which branch should I use? https://github.com/akka/akka/tree/release-2.3-dev ?

Greetz

You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/n9mhiztQxMo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.

Roland Kuhn

unread,
May 14, 2015, 2:04:45 AM5/14/15
to akka-user
13 maj 2015 kl. 21:52 skrev Martin Jöhren <m.jo...@gmail.com>:

Hi Roland,

I haven't found an issue for it so I go for the PR. Which branch should I use? https://github.com/akka/akka/tree/release-2.3-dev ?

Yes, that is the right branch, and please create an issue so that you can appropriately name your commits (see the CONTRIBUTING guide).

Thanks,

Roland

Martin Jöhren

unread,
May 16, 2015, 2:11:32 AM5/16/15
to akka...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages