Skip to content

fix: Implement file sharing password processing and remote download file name processing - #13452

Open
lan-yonghui wants to merge 1 commit into
dev-v2from
pr@dev-v2@fix_file
Open

fix: Implement file sharing password processing and remote download file name processing#13452
lan-yonghui wants to merge 1 commit into
dev-v2from
pr@dev-v2@fix_file

Conversation

@lan-yonghui

@lan-yonghui lan-yonghui commented Aug 3, 2026

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings August 3, 2026 11:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

The share page currently clears the entire URL hash after reading the password, which can unintentionally drop other hash parameters/fragments; it should remove only the password key.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR improves public file-sharing and remote download UX by (1) allowing share passwords to be embedded/extracted via the URL hash on the public share page, and (2) improving filename extraction for remote downloads (wget) with more robust URL parsing.

Changes:

  • Add file-share password propagation: append password to shared links (hash) and auto-apply it on the public share page.
  • Improve remote download filename parsing by using a dedicated URL/Content-Disposition-aware helper.
  • Centralize “public file share API” path detection in backend middleware and reuse it for proxy/session/password-expiration gating.
File summaries
File Description
frontend/src/views/share/index.vue Auto-reads share password from URL hash and applies it before checking/downloading.
frontend/src/views/host/file-management/wget/index.vue Uses a new helper to derive a safer/more accurate filename from a URL.
frontend/src/views/host/file-management/share/index.vue Uses a helper to copy share links that include password in the hash.
frontend/src/utils/file.ts Adds URL filename extraction utilities and file-share password hash helpers.
core/middleware/password_expired.go Exempts public share endpoints from password-expiration checks.
core/middleware/helper.go Introduces IsPublicFileShareAPI for shared backend checks.
core/init/router/proxy.go Reuses middleware IsPublicFileShareAPI and removes local duplicate logic.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment on lines +83 to +90
const applySharedPassword = () => {
const sharedPassword = getFileSharePasswordFromHash(window.location.hash);
if (!sharedPassword) {
return;
}
password.value = sharedPassword;
window.history.replaceState(window.history.state, '', `${window.location.pathname}${window.location.search}`);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants