Skip to content

fix: check etag quotes before unquote#129

Closed
ghost wants to merge 1 commit into
masterfrom
unknown repository
Closed

fix: check etag quotes before unquote#129
ghost wants to merge 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Sep 3, 2023

Copy link
Copy Markdown

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

emersion commented Sep 7, 2023

Copy link
Copy Markdown
Owner

This will not behave properly when encoding the value.

@ghost ghost closed this Sep 30, 2023
This pull request was closed.
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.

1 participant