8000 Clarify header grouping · Issue #47 · owin/owin · GitHub
[go: up one dir, main page]

Skip to content

Clarify header grouping #47

Open
Open

Description

@panesofglass

The spec currently declares:

Header values are assumed to be in a mixed format, meaning that a normally comma separated header may appear as a single entry in the values array, one entry per value, or a mixture of the two. (e.g. new string[1] {"value, value, value"}, new string[3] {"value", "value", "value"}, or new string[2] {"value, value", "value"})

However, as @kolektiv pointed out, that's not entirely clear. My best recollection is that OWIN would not change the header values, just pull all headers with the same header name into a single array, and the framework would then need to process the header values as received by the server.

I propose we amend to the following:

Header values are assumed to be in a mixed format, meaning that a normally comma separated header may appear as a single entry in the values array, one entry per value, or a mixture of the two (e.g. new string[1] {"value, value, value"}, new string[3] {"value", "value", "value"}, or new string[2] {"value, value", "value"}). Servers conforming to OWIN SHOULD NOT change the header values received in the HTTP request and SHOULD expose the header values as received.

I'm happy to change the above from SHOULD to MUST.

Activity

  1. serialseb commented on Oct 31, 2015

    @serialseb
    Contributor

    This is what i have in 1.0.1:

    Each value in the value array represents a single field line, with the dictionary key being the field name, and the field value being the value in the array.
    For example, the code headers["Accept"] = new[] {"text/html", "text/plain"} represents two field lines in an HTTP message:

    Accept: text/html
    Accept: text/plain

    Servers SHOULD NOT split, merge or otherwise unnecessarily modify the http header dictionaries, as applications may have incorrectly associated semantics to the order or number of multi-value headers.

  2. EddieGarmon commented on Nov 1, 2015

    @EddieGarmon

    The more we accommodate people doing the wrong thing in the first place, the harder it is to do things right.

  3. panesofglass commented on Nov 2, 2015

    @panesofglass
    MemberAuthor

    @EddieGarmon, I agree. @serialseb, I like what you have. I would lean towards wanting "MUST NOT," but I'm sure some server implementations already violate that condition, though I could be wrong.

  4. Tratcher commented on Nov 2, 2015

    @Tratcher
    Contributor

    Http.sys/IIS violates these guidelines for 'known' request headers. It's annoying sometimes. @EddieGarmon I agree in principal, but unfortunately most apps don't control their end-to-end stack and need to work around deficiencies in 3rd party components.

  5. EddieGarmon commented on Nov 2, 2015

    @EddieGarmon

    @Tratcher A specification is not an application.

    Either fully allow/support header modification/normalization or don't. Being on the fence in a spec leads to abuse and true non-adoption.

    Did HTTP/2 bend just because if a poor IIS implementation? I don't think so.

  6. serialseb commented on Nov 4, 2015

    @serialseb
    Contributor

    Do remember that we can't enforce additional restrictions on top of owin 1.0 (or any 1.x) as a SHOULD becoming a MUST would invalidate existing implementations that were valid before. 1.0.1 is supposed to clarify 1.0.0, not redefine it.
    The way to address these is either to postpone a better definition for a 2.0 (aka the ship has sailed), or work on a "Designed for OWIN" certification that has additional requirements (such as scoring on SHOULD and MUST and CAN and COULD and only providing the certification to 90% score or what not)

    Also, please note i'm waiting for comments on the other issues reported on the middleware spec brefore starting an RC vote, after whcih we can spend much time finalising 1.0.1.

  7. panesofglass commented on Nov 12, 2015

    @panesofglass
    MemberAuthor

    Comments added elsewhere (at last). :)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0