Skip to content

Conversation

@evankanderson
Copy link
Contributor

Update based on feedback from #456

  1. Define Context-Encoding header mapping based on datacontentencoding

  2. More clearly define percent-encoding (and particularly percent-decoding) rules.

…ore clearly define percent-encoding rules.Signed-off-by: Evan Anderson <[email protected]>

Signed-off-by: Evan Anderson <[email protected]>
@evankanderson
Copy link
Contributor Author

Question: this PR suggests encoding the : and / characters in attribute values when sending via HTTP binary mode.

Do we want to relax this and allow those characters to be written directly? The HTTP Location header (for example) allows this, so the current language is probably more restrictive than necessary.

@duglin
Copy link
Collaborator

duglin commented Aug 27, 2019

link checker errors look real

@clemensv
Copy link
Contributor

Based on the discussion in the last call, @duglin asked me to add a note here, @evankanderson

a) The PR #492 obsoletes the Content-Encoding discussion because it eliminates the attribute. The attribute was never meant to map to Content-Encoding. An HTTP implementation can nevertheless still use encodings like compression, but that's orthogonal to CloudEvents.

b) For strings, we need a hybrid of your clarification and the text it replaces. Tim's clarification for the String type in the core spec now makes it clear that we must be able to handle Unicode. That means the step "that the string MUST first be encoded according to UTF-8" from the prior text is indeed vital, but the following step in that text is unclear. The result of UTF-8 encoding is a sequence of characters of which the ASCII7 characters are unchanged and should show up as such (a pure plain ASCII string should just be plain ASCII in effect), but all further characters are percent encoded. That composes with your rule about the "token" set but we need to get both under one roof.

@evankanderson
Copy link
Contributor Author

Thanks for pointing out #490. I'll try to rework the text in 3.1.4.2 (will be 3.1.3.2 after removing datacontentencoding) to square the circle between what we allow in String and what's allowed in an HTTP header.

For example, HTTP headers dictate that leading and trailing whitespace are permitted around the header value -- section 3.2; similarly, multiple header values for the same field name should generally be combined into a single line using the , character -- section 3.2.2.

@evankanderson
Copy link
Contributor Author

I think I got what Clemens was suggesting; I suggested a two step encoding process:

  1. Convert to ASCII using percent-encoding
  2. Convert to HTTP header using header escaping

I also ran the prettier.io markdown formatter and rationalized some of the header formatting and end-matter links.

@evankanderson
Copy link
Contributor Author

This should be compatible with #492 now.

@evankanderson
Copy link
Contributor Author

Updated, this got lost between git commit and git push.

Therefore, and analog to the encoding rules for Universal character set host
names in URIs [RFC3986 3.2.2][rfc3986], the string value MUST be further encoded
as follows:
String values which contain Unicode characters outside the ASCII range MUST be
Copy link
Collaborator

Choose a reason for hiding this comment

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

we agreed on the call yesterday to remove the which contain Unicode characters outside the ASCII range text.

and per [RFC7230, section 3][rfc7230-section-3], HTTP headers MUST only use
printable characters from the US-ASCII character set, and are terminated by a
CRLF sequence.
CRLF sequence with optional whitespace around the header value.
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/optional/OPTIONAL/

@duglin
Copy link
Collaborator

duglin commented Sep 6, 2019

We approved this on the 9/5 call with the agreement to remove "which contain Unicode characters outside the ASCII range" from line 212

@evankanderson evankanderson force-pushed the hypertext-transport-binding branch 3 times, most recently from 2a4d562 to 646fddd Compare September 6, 2019 21:42
@evankanderson evankanderson force-pushed the hypertext-transport-binding branch from 646fddd to bc6763c Compare September 6, 2019 21:46
@duglin
Copy link
Collaborator

duglin commented Sep 6, 2019

@evankanderson thanks!! Merging per our approval on the call yesterday.

@duglin duglin merged commit 1404aaa into cloudevents:master Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants