Skip to content

Conversation

@JammingBen
Copy link
Contributor

Undo the change from c7072a7 for password protected links for now, until we ditch client-side signing.

refs opencloud-eu/opencloud#1712

@JammingBen JammingBen self-assigned this Nov 5, 2025
Copilot AI review requested due to automatic review settings November 5, 2025 09:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for password-protected public links when downloading archives. The implementation allows archives to be downloaded from public links that require authentication by adding a publicLinkPassword parameter and handling the authentication via Basic Auth.

Key changes:

  • Added publicLinkPassword parameter to archive download options
  • Implemented client-side fetch with Basic Auth for password-protected archives
  • Integrated password retrieval from auth store in the download archive action

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
packages/web-pkg/src/services/archiver.ts Added publicLinkPassword parameter and conditional fetch logic with Basic Auth for password-protected archives
packages/web-pkg/src/composables/actions/files/useFileActionsDownloadArchive.ts Integrated authStore to pass publicLinkPassword to archiver service for public space resources

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


const blob = await response.blob()
url = URL.createObjectURL(blob)
fileName = decodeURI(response.headers.get('content-disposition')?.split('"')[1])
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

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

This line will throw a TypeError if content-disposition header is missing or doesn't contain quotes. The optional chaining stops at get(), but split('"')[1] will fail if the header is null/undefined or doesn't have the expected format. Consider adding proper null checks: const contentDisposition = response.headers.get('content-disposition'); fileName = contentDisposition?.split('\"')[1] ? decodeURI(contentDisposition.split('\"')[1]) : 'archive';

Suggested change
fileName = decodeURI(response.headers.get('content-disposition')?.split('"')[1])
{
const contentDisposition = response.headers.get('content-disposition');
// Try to extract filename from header (handles quoted and unquoted)
const match = contentDisposition && contentDisposition.match(/filename\*?=(?:UTF-8'')?("?)([^";]+)\1/);
fileName = match ? decodeURI(match[2]) : 'archive';
}

Copilot uses AI. Check for mistakes.
@JammingBen JammingBen force-pushed the fix/public-password-archiver-2 branch 3 times, most recently from 61253ff to 532562d Compare November 5, 2025 09:43
Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

I'm 🥲 that we need it, but thank you for the fix either way!

@JammingBen JammingBen merged commit be6286e into main Nov 10, 2025
28 checks passed
@JammingBen JammingBen deleted the fix/public-password-archiver-2 branch November 10, 2025 13:38
openclouders pushed a commit that referenced this pull request Nov 10, 2025
…er-2

fix: archive download on password protected links
@openclouders openclouders mentioned this pull request Nov 10, 2025
1 task
@JammingBen
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
stable-4.2

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants