Skip to content

fix(sync): read response headers case-insensitively - #3443

Open
maximemoreillon wants to merge 1 commit into
nextcloud:mainfrom
maximemoreillon:fix/case-insensitive-sync-headers
Open

maximemoreillon wants to merge 1 commit into
nextcloud:mainfrom
maximemoreillon:fix/case-insensitive-sync-headers

Conversation

@maximemoreillon

Copy link
Copy Markdown

Currently, headers like ETag, Last-Modified and X-Notes-API-Versions are looked up with exact casing. However, header names should be case insensitive (RFC 9110).

Some reverse proxies like Cloudflare rewrite header names in lowercase, which the notes app consequently ignores, which triggers a complete re-sync of all notes.

This PR Closes #2531 by having the header matching case-insensitive.

🖼️ Screenshots

No UI change

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

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

Header names are case-insensitive (RFC 9110), but ETag, Last-Modified and
X-Notes-API-Versions were looked up with their exact casing. Behind proxies
that lowercase header names, such as Cloudflare or any HTTP/2 hop, the ETag
and modified time were never stored, so every sync used pruneBefore=0 and
downloaded every note in full.

Refs nextcloud#2531

AI-assistant: Claude Code 2.1.325 (Claude Opus 5.5)
Signed-off-by: Maxime Moreillon <m.moreillon@gmail.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

Syncing/refreshing is extremly slow

1 participant