Skip to content

fix: check etag quotes before unquote#129

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

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

Conversation

@ghost
Copy link

@ghost ghost 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.

@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