Skip to content

fix(avatar): add timeout and size limit when fetching remote avatars - #66161

Merged
AndyScherzinger merged 1 commit into
masterfrom
fix/remote-avatar-limits
Nov 2, 2026
Merged

AndyScherzinger merged 1 commit into
masterfrom
fix/remote-avatar-limits

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Remote avatars were added in #62355 to show the owners of federated shares. They're only needed for logged-in users, so this skips the lookup otherwise. The fetch also used the default 30 s timeout and kept the whole response in memory.

Now it uses a 5 s timeout and streams the response with a 2 MiB cap, like the link preview fetch does. A missing or invalid Content-Length is rejected.

Covered by unit tests.

TODO

  • Backport to stable35

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

Remote avatars are used to show the owners of federated shares, so only
look them up for logged-in users. Use a short timeout and stream the
response with a 2 MiB limit, like the link preview fetch does.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv requested a review from a team as a code owner November 2, 2026 20:25
@skjnldsv skjnldsv self-assigned this Nov 2, 2026
@skjnldsv
skjnldsv requested review from Altahrim, CarlSchwan, icewind1991, leftybournes, provokateurin, sorbaugh and susnux and removed request for a team November 2, 2026 20:25
@skjnldsv

skjnldsv commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

/backport! to stable35 please

@AndyScherzinger
AndyScherzinger merged commit 06efce9 into master Nov 2, 2026
155 of 161 checks passed
@AndyScherzinger
AndyScherzinger deleted the fix/remote-avatar-limits branch November 2, 2026 20:58
@skjnldsv

skjnldsv commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

/backport to stable34 please

@skjnldsv

skjnldsv commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

/backport to stable33 please

@backportbot

backportbot Bot commented Nov 3, 2026

Copy link
Copy Markdown

The backport to stable34 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable34
git pull origin stable34

# Create the new backport branch
git checkout -b backport/66161/stable34

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 2d8694d6

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/66161/stable34

Error: Failed to check for changes with origin/stable34: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot

backportbot Bot commented Nov 3, 2026

Copy link
Copy Markdown

The backport to stable33 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable33
git pull origin stable33

# Create the new backport branch
git checkout -b backport/66161/stable33

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 2d8694d6

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/66161/stable33

Error: Failed to check for changes with origin/stable33: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

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