Fix onHeaders error when trying to use Rook middleware