-
Notifications
You must be signed in to change notification settings - Fork 87
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
Ensure authority and/or host fields are not empty #232
Conversation
8180959
to
9c3c83c
Compare
I am unsure how to correctly to create a HeaderField with an empty value for the tests. If that is even possible. If it isn't then maybe this PR is redundant and I should only update the compliance? |
Hi, thanks for the PR! I would leave the check and the test for the |
@Ruben2424 as it turns out, once I got the tests working I discovered that the initial code already errors out when either field is empty. The host field errors out when it is built into a Uri since the Uri Builder rejects empty Uris. At least we have more tests and documentation now |
h3/src/proto/headers.rs
Outdated
@@ -202,6 +201,9 @@ impl Iterator for HeaderIter { | |||
} | |||
} | |||
|
|||
//= https://www.rfc-editor.org/rfc/rfc9114#section-4.3.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far. Do you mind moving that comment to the Field::parse
method? The parse method will return the error when authority
is empty. So one can find the location when looking through the compliance report.
iirc the error comes from here:
Line 294 in b44edeb
b":authority" => Field::Authority(try_value(name, value)?), |
We could have an authority or host that consists of an empty string