mjackson / rack-accept

HTTP Accept* for Ruby/Rack
http://mjackson.github.com/rack-accept
47 stars 16 forks source link

Testing header presensce #20

Open sideshowcoder opened 7 years ago

sideshowcoder commented 7 years ago

Allowing to easily determine if a header is actually present in the HTTP connection. This is useful to determine if when using best_of the fallback should be a global fallback for the header or whatever is returned by best_of.

This avoids relying on the ordering of options passed to best_of, as without a presence check the selected option would be the first option passed.