Remove 'server' and 'via' headers from heroku?
I suspect that Heroku adds those headers after your code runs, so there might not be a lot you can do to remove it. The response is probably on its way out the door as the extra headers are added.
You could experiment and try setting your own values for those two headers, and see if Heroku will be polite enough to not override them. But that's not much help if your goal is to have the headers not be present at all.