I know a Rack middleware filter is a Ruby class with an initialize and a call method. I know the call method takes an \"env\" argument. Something like this:
Looking at the source code depending on which web server you have you can get different values in your env hash. I recommend only using what's in the documentation.
Basically the env is a hash version of the request object specific to the web server. Rack does some work to give a normalized env so the middleware can behave consistently across web servers.