Much nicer error pages

This commit is contained in:
Tomasz Drwięga
2016-08-31 16:53:22 +02:00
parent 25e6a4e45f
commit 2789824a51
7 changed files with 108 additions and 40 deletions

View File

@@ -55,10 +55,9 @@ impl Authorization for HttpBasicAuth {
match auth {
Access::Denied => {
Authorized::No(Box::new(ContentHandler::new(
Authorized::No(Box::new(ContentHandler::error(
status::StatusCode::Unauthorized,
"<h1>Unauthorized</h1>".into(),
"text/html".into(),
"Unauthorized", "You need to provide valid credentials to access this page.", None
)))
},
Access::AuthRequired => {