build_app destroys the middleware hash:
klass = middleware.shift
app = klass.new(app, *middleware)
As this is a class variable, a second start of Rack::Server does not work.
Instead, build_app should be changed as below:
klass = middleware
app = klass.new(app, *middleware[1..-1])
(server.rb, line 304)
Don't modify the middleware hash in Rack::Server
* Closes #498
I don't modify it. Rack does it itself by calling "shift" on it in in build_app! Please re-open the ticket.
It's fixed in the attached commit.