Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check etag quotes before unquote #129

Closed
wants to merge 1 commit into from
Closed

fix: check etag quotes before unquote #129

wants to merge 1 commit into from

Conversation

in0rdr
Copy link

@in0rdr in0rdr commented Sep 3, 2023

I encountered the same issue with non-standard (unquoted) etags from my caldav server as my predecessors:

go test
--- FAIL: TestETagUnmarshalText (0.00s)
    elements_test.go:79: UnmarshalText failed for ETag: webdav: failed to unquote ETag: invalid syntax
FAIL
exit status 1
FAIL    github.com/emersion/go-webdav/internal  0.006s

This patch will check the etag first, before calling the strconv.Unquote function. A string without quotes will not be unquoted.

@emersion
Copy link
Owner

emersion commented Sep 7, 2023

This will not behave properly when encoding the value.

@in0rdr in0rdr closed this Sep 30, 2023
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.

2 participants