Fix error with single file download on protected shares#188
Fix error with single file download on protected shares#188benediktpenner wants to merge 1 commit intoErugoOSS:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #187 where single file downloads from password-protected shares failed with a "Password required" error even when the password was entered. The fix changes the single file download mechanism to use POST requests (when a password is provided) instead of GET redirects, allowing the password to be transmitted properly to the backend.
Changes:
- Modified the API route for single file downloads to accept both GET and POST methods
- Updated the downloader component to pass the password to child directory-item components
- Enhanced the directory-item component to submit passwords via POST form when downloading files
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| routes/api.php | Changed the downloadFile route from GET-only to accept any HTTP method (GET/POST), enabling password transmission for protected shares |
| resources/js/components/downloader.vue | Added password prop to the directory-item component to enable password-protected downloads |
| resources/js/components/directory-item.vue | Added password prop, implemented POST form submission for password-protected downloads, and propagated password to nested subdirectories |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| form.method = 'POST' | ||
|
|
||
| const passwordInput = document.createElement('input') | ||
| passwordInput.type = 'hidden' |
There was a problem hiding this comment.
For consistency with the existing pattern in downloader.vue (line 92), the password input type should be 'password' instead of 'hidden'. While both work for form submission, using 'password' maintains consistency across the codebase.
| passwordInput.type = 'hidden' | |
| passwordInput.type = 'password' |
There was a problem hiding this comment.
This could cause a flickering UI when downloading a file as the input is shown for some milliseconds.
|
Thank you for this fix. I will validate in merge it in the next few days |
This changes are a possible fix for #187
I'm not a vue developer so it's AI generated and may be not perfect (but better than my code)