Skip to content

fix: avoid treating empty values as valid CSV input #165

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

miraclx
Copy link

@miraclx miraclx commented Jan 26, 2024

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.

This fixes that.

@paolobarbolini
Copy link
Contributor

This will also fix my issue #148

@evgenykobz
Copy link

Second this: this bug breaks OptionalFromRequestParts implementations.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants