Skip to content

meaning of browser_preferred API #4

@HoneyryderChuck

Description

@HoneyryderChuck

First things first, great lib! I've been looking for a way to "componentize" facilities for HTTP metadata handling which are now kinda centralized in rack. Good that someone has been having the same forward thinking!

I wanted to question the meaning of the "browser_preferred*" APIs. Is it really something necessary? The way I see it, you expect an env hash, which probably is CGI/Rack API and has nothing to do with browsers, but what if I have an headers container which handles keys in a different way? The Rack/CGI spec maps headers to HTTP_ACCEPT_* envvars/keys, but I can have a container of lowercased headers. (Accept-Encoding-> accept-encoding). This is what net/http does btw.

Of course, the "parse" methods already handle passing the header value. But do those methods have to be loaded with core?

I'm talking p. ex. about https://github.com/ioquatix/http-accept/blob/master/lib/http/accept/encodings.rb#L65-L91

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