From d55de8c8cd746a7d5c537c3b2ca49994d3007b66 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 13 Nov 2018 22:10:13 +0100 Subject: Add 400 error page HTML copied from the 404 page, but I remove the `text-center` on the error message because it doesn't look good. Took a multiline message for me to realise it. --- license-generator/src/bin/license.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'license-generator/src/bin') diff --git a/license-generator/src/bin/license.rs b/license-generator/src/bin/license.rs index 8c77670..f35407b 100644 --- a/license-generator/src/bin/license.rs +++ b/license-generator/src/bin/license.rs @@ -55,6 +55,11 @@ where W: 'a + Write { } fn error_400(&mut self) { + let page_400 = include_str!("../../../400.html"); + response::set_400(self.writer) + .and_then(|_| + Ok(write!(self.writer, "Content-Type: text/html\n\n{}", page_400)?) + ).unwrap_or(()) } fn error_404(&mut self) { -- cgit v1.2.3