-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
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