Skip to content

encoding: parse still spec-incomplete #5

@HoneyryderChuck

Description

@HoneyryderChuck

I've been trying to readapt my accept-encoding specs using this library, and found that some things from the spec aren't implemented. Two stand out for now:

  • q=0 aren't being ignored. According to the spec, this means that you explicitly don't want a specific encoding. This is specially valuable for identity.
HTTP::Accept::Encodings.parse("identity;q=0")
# expects #=> []
# returns #=> [#<struct HTTP::Accept::Encodings::ContentCoding encoding="identity", q="0">]

this might have been by design (parse-don't-eval), but in all cases you are creating a needless structure.

  • identity isn't explicitly added to the parsing list:
HTTP::Accept::Encodings.parse("gzip;q=1")
# expects #=> [struct gzip, struct identity]
# returns #=> [struct gzip]

again, this might have been intended this way, but as referenced in the case above, sometimes you want to explicitly turn off identity, so you'd have to pass identity in all cases.

This is mostly a reference to the rack specs for encoding. Feel free to ignore this issue if the single purpose is to parse, not evaluate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions