middleware: error page set the content-type