The whole else branch is just copied from server.rb (and we have same code at other places as well).

Actually, I have no idea if it should be there