While using Axum, I noticed If-Match & If-None-Match would always default to Some("") making it difficult to know if the user passed the headers as If-Match: or not at all.
I looked into the code, and it turns out the logic for consuming the values iterator defaults to an empty byte array (ergo, empty string)
I chose this peeking method and short-circuiting before calling collect to avoid more complex patterns.
And tags in If-Match & If-None-Match (depending on EntityTagRange) weren't being validated.
While using Axum, I noticed
If-Match
&If-None-Match
would always default toSome("")
making it difficult to know if the user passed the headers asIf-Match:
or not at all.I looked into the code, and it turns out the logic for consuming the values iterator defaults to an empty byte array (ergo, empty string)
I chose this peeking method and short-circuiting before calling
collect
to avoid more complex patterns.And tags in
If-Match
&If-None-Match
(depending onEntityTagRange
) weren't being validated.This fixes that.