Skip to content

fix(webdav): handle weak and quoted gzip ETags - #2139

Open
joshtrichards wants to merge 1 commit into
masterfrom
jtr/webdav-etag-parsing-cleanup
Open

fix(webdav): handle weak and quoted gzip ETags#2139
joshtrichards wants to merge 1 commit into
masterfrom
jtr/webdav-etag-parsing-cleanup

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

Better Android WebDAV ETag parsing with the desktop client's behavior.

The redundant lowercase response-header lookups were also removed because both underlying response APIs perform case-insensitive header-name matching.

Previously, parseEtag():

  • Removed -gzip only before removing surrounding quotes.
  • Did not remove the weak ETag prefix (W/).
  • Therefore failed to normalize values such as W/"abc-gzip": the -gzip suffix was hidden behind the closing quote, and W/ was retained.

This change normalizes ETags in the following order:

  1. Remove the weak validator prefix (W/).
  2. Remove surrounding double quotes.
  3. Remove a trailing -gzip suffix.

Examples:

Raw ETag Before After
W/"abc-gzip" W/"abc-gzip" abc
"abc-gzip" abc-gzip abc
"abc-gzip-value" abc-gzip-value abc-gzip-value
abc-gzip-gzip abc-gzip abc-gzip

🤖 AI (if applicable)

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

Better align Android WebDAV ETag parsing with the desktop client's behavior and fix some minor bugs in it.

Signed-off-by: Josh <josh.t.richards@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

SpotBugs

CategoryBaseNew
Bad practice3131
Correctness2828
Dodgy code1313
Internationalization66
Malicious code vulnerability2626
Multithreaded correctness77
Performance33
Security33
Total117117

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.

1 participant