Skip to content

v3.x: Does the Encoding Object's contentType allow whitespace around commas? #4788

Closed

Description

@handrews

I expected it would (e.g. contentType: text/css, text/javascript, image/*) by analogy with the Accept header, while @ralfhandl read it more literally and expects only contentType: text/css,text/javascript,image/* would be allowed. I suppose it depends on your assumptions on the phrase "comma-separated list" which is all we say about it.

Activity

  1. added
    clarificationrequests to clarify, but not change, part of the spec
    media and encodingIssues regarding media type support and how to encode data (outside of query/path params)
    on Jul 17, 2025
  2. handrews commented on May 12, 2026

    @handrews
    MemberAuthor

    @ralfhandl is there any reason to restrict this? It's supposed to be analogous to Accept, which allows whitespace. Perhaps it is different in German but in English "comma-separated list" usually allows a space. You can see a clear example of this at the very end of §8.6 of RFC9110:

    a recipient of a Content-Length header field value consisting of the same decimal value repeated as a comma-separated list (e.g, "Content-Length: 42, 42")

    This usage is consistent throughout RFC9110, which I think is a pretty solid precedent. I think we should close this, or at most add a note emphasizing that whitespace is allowed. But really, I think 9110 is the governing precedent here.

  3. karenetheridge commented on May 12, 2026

    @karenetheridge
    Member

    Personally I would not interpret "comma-separated list" as allowing whitespace if it was not explicitly stated. But indeed whitespace after commas is common in other places in RFC9110 so it would seem reasonable to allow it.

    The best way to resolve this is to provide an ABNF for this field (using definitions established in RFC9110):

    contentType = media-range *( "," OWS media-range )
    
  4. miqui commented on May 12, 2026

    @miqui
    Contributor

    Personally I would not interpret "comma-separated list" as allowing whitespace if it was not explicitly stated. But indeed whitespace after commas is common in other places in RFC9110 so it would seem reasonable to allow it.

    Same here

  5. handrews commented on May 12, 2026

    @handrews
    MemberAuthor

    I personally think that anything that is related to RFC9110 inherently uses its parsing rules because RFC9110 is a normative reference, but if someone feels compelled to write a PR for this, please go ahead. If no one is motivated to write a PR, let's close this.

  6. added
    Needs attentionThe author has replied and people with triage rights should take action.
    and removed on May 12, 2026
  7. added 4 commits that reference this issue on May 19, 2026
    b44e42d
    920a9fb
    9bcf685
    7bd7fb0
  8. added 6 commits that reference this issue on Jun 4, 2026
    c09670d
    a283add
    1d3803b
    f928af5
    51922cc
    8f12af7
  9. added a commit that references this issue on Jul 8, 2026
    16734c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs attentionThe author has replied and people with triage rights should take action.clarificationrequests to clarify, but not change, part of the specmedia and encodingIssues regarding media type support and how to encode data (outside of query/path params)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions