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

field name can not by empty #684

Merged
merged 1 commit into from Jan 2, 2019
Merged

field name can not by empty #684

merged 1 commit into from Jan 2, 2019

Conversation

justjavac
Copy link
Contributor

header-name can not by empty string

https://tools.ietf.org/html/rfc7230#section-3.2

header-field   = field-name ":" OWS field-value OWS

field-name     = token
field-value    = *( field-content / obs-fold )
field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]
field-vchar    = VCHAR / obs-text

obs-fold       = CRLF 1*( SP / HTAB )
               ; obsolete line folding
               ; see Section 3.2.4

Browser Compatibility:

Firefox:

let headers = new Headers();
headers.set('', 'foo');  // TypeError:  is an invalid header name.

Chrome:

let headers = new Headers();
headers.set('', 'foo');  // TypeError: Failed to execute 'set' on 'Headers': Invalid name

Copy link

@keithamus keithamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @mislav?

@mislav mislav merged commit 3674c98 into JakeChampion:master Jan 2, 2019
@mislav
Copy link
Contributor

mislav commented Jan 2, 2019

Looks good; thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants