-
Notifications
You must be signed in to change notification settings - Fork 218
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 tests for quoted strings in headers #986
Add tests for quoted strings in headers #986
Conversation
headers: { | ||
"X-StringList": """ | ||
a, "b,c", "\"def\"" | ||
""" |
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.
This should go on the previous line. By putting it on the next line, it's inserting a "\n".
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.
Yes, but if I turn that into:
headers: {
"X-StringList": """
a, "b,c", "\"def\"""""
},
Then the entire file doesn't parse. I can work around this by flipping the order of the parameters, or by adding a whitespace (which is ignored according to spec)
headers: { | ||
"X-StringList": """ | ||
a, "b,c", "\"def\"" | ||
""" |
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.
Same issue - needs to be on the previous line
RFC 7230 sec 3.2.6 defines header values as potentially quoted strings, which makes commas in header values unambiguous. It's also the only way to escape a reserved character. This adds a test for list values with a comma and for list values with escaped double quotes.
3cbfeef
to
58c7c12
Compare
Description of changes:
RFC 7230 sec 3.2.6 defines header values as potentially quoted strings, which
makes commas in header values unambiguous. It's also the only way to escape a
reserved character. This adds a test for list values with a comma and for list
values with escaped double quotes.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.