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

webdav: ConditionalMatch with multiple etags #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

barkyq
Copy link

@barkyq barkyq commented Jan 13, 2025

//
// The function returns early if no ETags are set (isSet is false) or if a wildcard (*) is used,
// in which case all ETags match. For multiple ETags, it checks each one until a match is found or all are checked.
func (val ConditionalMatch) MatchETag(etag string) (isSet bool, match bool, err error) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rationale for returning isSet

the MatchETag function should check whether val.IsSet() is non-nil, otherwise it leads to the wrong behaviour.

this seemed the only reasonable solution (beyond implementors inspecting error types), and reduces boilerplate code for implementations.

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