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

Parameter value "" (quoted-string, empty string value) #78

Closed
bathos opened this issue Sep 8, 2018 · 2 comments
Closed

Parameter value "" (quoted-string, empty string value) #78

bathos opened this issue Sep 8, 2018 · 2 comments

Comments

@bathos
Copy link

bathos commented Sep 8, 2018

I believe the current parsing algorithm is intended to describe a superset of the RFC grammar, but in one respect it appears to depart:

§ 4.4 Parsing a MIME type

In step 7’s substeps, when the value portion of a parameter is a quoted string, the parameterValue being assembled is the string value (that is, with escapes resolved and without the surrounding quotation marks).

In step 8, the resulting key-value pair is only appended if “parameterValue is not the empty string.”

Contrast with the grammar in the RFCs, where key="" is permitted (the quoted portion is the production quoted-string, RFC 7230 § 3.2.6*). For this input, parameterValue will have been the empty string, so the pair will be ignored.

Is this an intentional departure, am I missing another step here, or is it a mistake?

If it is a mistake, note that the empty string check is still required, but only in the not-a-quoted-string branch (11 -> 7 -> 2).


* DQUOTE *( qdtext / quoted-pair ) DQUOTE, note the kleene star

@annevk
Copy link
Member

annevk commented Sep 10, 2018

Thanks for spotting that, that is unintentional!

@annevk
Copy link
Member

annevk commented Sep 10, 2018

cc @hsivonen @MattMenke2

annevk added a commit that referenced this issue Sep 10, 2018
As pointed out in the issue, this is also allowed by RFC 7230 (HTTP).

Tests: ...

Fixes #78.
annevk added a commit that referenced this issue Sep 14, 2018
As pointed out in the issue, this is also allowed by RFC 7230 (HTTP).

Tests: web-platform-tests/wpt#12925.

Fixes #78.
annevk added a commit that referenced this issue Sep 14, 2018
As pointed out in the issue, this is also allowed by RFC 7230 (HTTP).

Tests: web-platform-tests/wpt#12925.

Fixes #78.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants