Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Infinite loop resulting in stack level too deep in Sinatra::Response#finish #612
If the call to super on line 86 returns a Rack::BodyProxy instance inside result, the equality comparison on line 87 fails. The end result will be an infinite loop when calling #each on body, which will cause a stack overflow.
Rather than add || Rack::BodyProxy === result on line 86, I suggest we overload the "==" operator in Sinatra::Response, to perform compare instances based solely on the status, headers, body and length attribute (of course, the comparison on line 86 needs to be flipped to self == result).