-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add an option for directory listing, default disabled #4
base: main
Are you sure you want to change the base?
Conversation
Hey Quinn, thanks for the PR! Good news, this change is very much in scope for this package. The reason it exists is to add gzip-compression behavior to However, I'm not completely sure what its default value should be. I see some tradeoffs. But first, let me ask about something you said:
Can you tell me what makes you say that? As far as I know, So, here are the tradeoffs between the two options:
So, at this point, it's a bit unclear whether it should be made on or off by default. Making it off would be a breaking behavior and users need to be updated, but I don't mind making those fixes and sending PRs in clients if the API is in fact better. But, at this point, I'm not convinced which default is actually better. Thoughts? |
Thanks for the thoughtful reply. I apparently was mistaken about the standard library’s http package not offering directory listings. I personally think it introduces an additional security concern and should be off by default (everywhere, even Apache httpd, etc.), but it’s your call.
|
Fair enough. Just checking, but what did you think of my point that it might offer a false sense of security unless filenames are treated as sensitive tokens, i.e., they need to generated using a cryptographically secure source of randomness, and be long enough, otherwise they can be guessed? |
I see the argument but I personally don’t agree. Usually the argument comes up when one considers whether to add something that marginally increases perceived security, not when one considers whether to remove something that marginally decreases actual security. I don’t begrudge anyone who disagrees though! Both ways are valid.
|
Merge upstream master
We have the need to disable this again. Instead of forking and using our fork, would it be OK to merge this if the default remained true? |
Thanks for the great package!
This PR makes the directory listing feature require an explicit option
DirListing
. This prevents users from mistakenly enabling directory listings for assets, which could be bad for users wanting assets only to be accessible to end users who know the specific path names.I think making this feature opt-in is better because this library describes itself as
provid[ing] net/http-like primitives
. Thenet/http
package'sFileServer
type does not provide directory listings, and directory listings are arguably not a "primitive".