This started off as fixing a bug where weak-prefixed values were not properly validated, and turned into a larger refactor to extract all of the repeated validation and parsing logic into a common ETag class.

If you'd like me to go a different route, just let me know. 😃

Comment From: rstoyanchev

It is better to separate the bug fix from a wider refactoring. The bug fix, depending on severity can be backported for minimum disruption, while the refactoring may be applied selectively or only for future releases.

Could you provide a description of the bug please? The link to a draft commit did not make it obvious.

Comment From: kashike

Hey @rstoyanchev! The validation logic checks for a prefix of W/ when it should be checking for W/". As per the spec (see here and here) this allows invalid values to pass through.

Comment From: rstoyanchev

Yes, I see now. Could you submit a separate PR with just the bug fix please? There is still chance to have that applied to the upcoming releases this week. As for the broader refactoring, we can discuss that separately.

Comment From: kashike

@rstoyanchev #33374

Comment From: rstoyanchev

Thanks. I've processed #33374 and backported it to 6.0.x and 5.3.x.

As for the wider refactoring, coincidentally we had plans also to make efficiency improvements under #33372, and that will include encapsulation of the logic for better re-use.

I'm closing this for now, but please do follow #33372, and we'll see if there is anything left after it.