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

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

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

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.

2 participants