-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add fields.has
#91
Add fields.has
#91
Conversation
This comment is now obsolete Before we land this I believe we need to make this change in structure consistent in the other field methods:
|
After some discussion, I think the right change here is instead to add the |
e45c02d
to
2f3ac89
Compare
Could we implement both changes? |
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.
+1 to adding fields.has
. I appreciate that we are able to avoid changing the types on any other fields methods by using ""
to represent the empty value.
2f3ac89
to
7e2ea3c
Compare
I think that since we're using |
Co-authored-by: Pat Hickey <pat@moreproductive.org>
461e3c6
to
32dd769
Compare
This sounds reasonable in equating the empty string with an empty header value. This then makes it easy to set an empty header and compose it the other functions like append and set as @pchickey mentions in #91 (comment). In the WhatWG implementation Edit: I think this approach still allows multiple empty header values just fine in that |
It's not currently possible to test whether a
field-key
is present in afields
, as our return value of an empty list could mean either that the header was missing, or had no value. Add thefields.has
method to give an unambiguous way to test forfield-key
presence in afields
.Fixes #82