Skip to content

fix(appstore): use URL-safe base64 encoding for user content proxy URLs - #63139

Open
edward-ly wants to merge 1 commit into
masterfrom
fix/noid/usercontent-base64-urlencode
Open

fix(appstore): use URL-safe base64 encoding for user content proxy URLs#63139
edward-ly wants to merge 1 commit into
masterfrom
fix/noid/usercontent-base64-urlencode

Conversation

@edward-ly

@edward-ly edward-ly commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Some app screenshot URLs in the proxy server may include the '/' character in their base64 encoding, but since '/' is a prohibited character for file names, the computed proxy server URL was invalid and such screenshots would fail to be retrieved (or rather, the screenshots weren't saved to begin with because of this). This is addressed by making the encoding URL-safe (e.g. replacing / and + with _ and -, respectively).

Accompanies nextcloud/usercontent.apps.nextcloud.com#25.

Checklist

@edward-ly
edward-ly force-pushed the fix/noid/usercontent-base64-urlencode branch from e9e3e1d to 9804988 Compare August 11, 2026 14:29
@edward-ly edward-ly added the 3. to review Waiting for reviews label Aug 11, 2026
@edward-ly

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@edward-ly

Copy link
Copy Markdown
Contributor Author

/backport to stable33

@edward-ly

Copy link
Copy Markdown
Contributor Author

/backport to stable32

@edward-ly
edward-ly marked this pull request as ready for review August 11, 2026 15:52
@edward-ly
edward-ly requested a review from a team as a code owner August 11, 2026 15:52
@edward-ly
edward-ly requested review from leftybournes, provokateurin, salmart-dev and sorbaugh and removed request for a team August 11, 2026 15:52
@edward-ly edward-ly added this to the Nextcloud 35 milestone Aug 18, 2026
@edward-ly
edward-ly force-pushed the fix/noid/usercontent-base64-urlencode branch from 9804988 to 7370161 Compare August 18, 2026 16:50
@nextcloud-bot nextcloud-bot mentioned this pull request Aug 20, 2026
@skjnldsv skjnldsv mentioned this pull request Aug 25, 2026
@edward-ly
edward-ly force-pushed the fix/noid/usercontent-base64-urlencode branch from 7370161 to 1781104 Compare August 27, 2026 15:04
@edward-ly

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@susnux susnux 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.

Usually url safe encoding also strips off the = padding

@edward-ly

edward-ly commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Usually url safe encoding also strips off the = padding

Sure, but Python doesn't trim the =, probably because you wouldn't be able to decode and get back the original URL if you do.

@susnux

susnux commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Just asking because = also has special meaning in URLs and usually you remove the padding - you can always add it back later like

def urlsafe_b64decode_nopad(data: bytes) -> bytes:
    pad = b'=' * (4 - (len(data) & 3))
    return base64.urlsafe_b64decode(data + pad)

But if this is not needed here then ok :)

@edward-ly

Copy link
Copy Markdown
Contributor Author

Ah right, that is true. Still, we haven't had any issues with the = so far; only the / has been causing real problems.

@edward-ly
edward-ly force-pushed the fix/noid/usercontent-base64-urlencode branch from 1781104 to f32b71b Compare August 27, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants