Special-casing sinatra. Very upset about putting framework-related code in a rack middleware. Konstantin owes me a margarita.