w3c / baggage

Propagation format for distributed context: Baggage
https://w3c.github.io/baggage/
Other
47 stars 18 forks source link

Remove optional whitespace #53

Closed dyladan closed 1 year ago

dyladan commented 3 years ago

As discussed in the working group meeting on April 6, optional whitespace reduces clarity for things like determining the maximum length limits, and determining if a whitespace character is a part of the key or value.

In the meeting it was discussed that OWS would be removed

SergeyKanzhelev commented 3 years ago

A few problems with removing OWS:

  1. Some frameworks will insert spaces in multi-value headers
  2. High chance of user error when authoring the header
  3. Become unaligned with other multi-value headers which allow the spaces

    Rationale has some reasoning too and needs to be updated if we go ahead with it: https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT_RATIONALE.md#trimming-of-spaces

dyladan commented 3 years ago
  1. Some frameworks will insert spaces in multi-value headers

Can you provide an example framework?

  1. High chance of user error when authoring the header

Not sure I agree. There are no whitespace characters allowed in keys or values and the example header looks much more confusing to me with whitespace than without. In addition, the header shouldn't be often authored by hand but by machines which don't become confused by lack of whitespace.

  1. Become unaligned with other multi-value headers which allow the spaces

Can you provide an example? At least the cookie header defined in https://tools.ietf.org/html/rfc6265#section-5.4 does not have OWS

Rationale has some reasoning too and needs to be updated if we go ahead with it: https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT_RATIONALE.md#trimming-of-spaces

👍

SergeyKanzhelev commented 3 years ago

there seems to be mess up with the link to RFC in this:

Multiple baggage headers are allowed. Values can be combined in a single header according to RFC 7230.

I found this:

https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

It seems to be saying that LWS is OK and appending headers with comma is OK. Making OWS a legit need.

As for the frameworks, @reyang do you remember?

reyang commented 3 years ago

I don't recall the exact framework as it has been more than 3 years since I touched this topic. IIRC @SergeyKanzhelev and I saw this in some old version of ASP.NET (running in IIS).

kalyanaj commented 2 years ago

@dyladan will be updating this as many of the original concerns may not apply anymore (e.g. we don't have maximum limits anymore).

dyladan commented 1 year ago

With limits section changed to reference minimums instead of maximums I believe the question of OWS is resolved. A serializer can just omit the OWS if they desire, but there is no maximum character limit they must worry about.