-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
CanGoUp appears broken in fileserver module #3942
Comments
Thanks for opening an issue! We'll look into this. It's not immediately clear to me what is going on, so I'll need your help to understand it better. Ideally, we need to be able to reproduce the bug in the most minimal way possible. This allows us to write regression tests to verify the fix is working. If we can't reproduce it, then you'll have to test our changes for us until it's fixed -- and then we can't add test cases, either. I've attached a template below that will help make this easier and faster! This will require some effort on your part -- please understand that we will be dedicating time to fix the bug you are reporting if you can just help us understand it and reproduce it easily. This template will ask for some information you've already provided; that's OK, just fill it out the best you can. 👍 I've also included some helpful tips below the template. Feel free to let me know if you have any questions! Thank you again for your report, we look forward to resolving it! Template
Instructions -- please heed otherwise we cannot help you (help us help you!)
Example of a tutorial: Create a config file: |
Thanks @mholt! Sorry if there was a template I should've followed from the start -- my mistake. 1. Environment1a. OS version
1b. Caddy version
1c. Go version
2. Description2a. What happens
2b. Why it's a bug (if it's not obvious)Given the current code (see below) I would expect to see a caddy/modules/caddyhttp/fileserver/browsetpl.go Lines 336 to 348 in 2b90cdb
caddy/modules/caddyhttp/fileserver/browse.go Lines 96 to 107 in 7d7434c
2c. Log output
2d. Workaround(s)A bodge is to use a custom template that omits the 2e. Relevant linksAn idea of what I'd expect can be seen by browsing around the directories here though do bare in mind I've changed the default template slightly (reworded 'Go up' to 'Parent Directory' and added a 3. Tutorial
I would expect the last command to return some matches from |
That is an excellent report. Thank you! The tutorial is perfect. (And don't worry, you didn't miss the template; we only ask for it when we think it'll be helpful.) Found the bug pretty quickly thanks to that information. Pushing a fix now. |
You can try it out by downloading the appropriate build artifact at the bottom of this page: https://github.com/caddyserver/caddy/actions/runs/452872923 |
Fantastic - thanks for the quick fix! I can confirm this now works as expected for me too. 🚀 |
From reading the source below, it appears there should be a "Go up" link on all directory listings which have a parent directory which itself is also browsable by the user.
caddy/modules/caddyhttp/fileserver/browsetpl.go
Lines 336 to 348 in 2b90cdb
However it appears this is broken and that
CanGoUp
is always false for some reason. This in turn means that the link to the parent directory is not shown when I'd expect it to be.Hope all the Caddy maintainers had a good Christmas and wishing you all a Happy New Year!
The text was updated successfully, but these errors were encountered: