pub fn http_error(status: StatusCode, header: &str, body: &str, smaller: bool) -> HttpResponse {
	let head = if smaller {HEADSPL} else {HEAD};

	HttpResponse::Ok()
		.status(status)
		.encoding(ContentEncoding::Auto)
		.if_true(status == StatusCode::UNAUTHORIZED, |builder| {
			builder.header(header::WWW_AUTHENTICATE, "Basic realm=\"Please provide valid credentials to access this resource.\"");
		})
		.header(header::SERVER, "KatWebX")
		.content_type("text/html; charset=utf-8")
		.body([head, "<title>", header, "</title><h1 class=err>", ERRSVG, &encode_minimal(header), "</h1><p>", &encode_minimal(body), "</p><span class=bottom>Powered by KatWebX</span>"].concat())
}
// http_error generates a server HTTP error page, using the provided data.
// If the "smaller" option is set to true, the page will be generated using the default sans-serif font, instead of the Product Sans font.
http_error generates a server HTTP error page, using the provided data.
If the "smaller" option is set to true, the page will be generated using the default sans-serif font, instead of the Product Sans font.
http_error generates a server HTTP error page using the provided data . If the " smaller " option is set to true the page will be generated using the default sans - serif font instead of the Product Sans font .
pub fn http_error(status: StatusCode, header: &str, body: &str, smaller: bool) -> HttpResponse {
	let head = if smaller {HEADSPL} else {HEAD};
	HttpResponse::Ok()
		.status(status)
		.encoding(ContentEncoding::Auto)
		.if_true(status == StatusCode::UNAUTHORIZED, |builder| {
			builder.header(header::WWW_AUTHENTICATE, "Basic realm=\"Please provide valid credentials to access this resource.\"");
		})
		.header(header::SERVER, "KatWebX")
		.content_type("text/html; charset=utf-8")
		.body([head, "<title>", header, "</title><h1 class=err>", ERRSVG, &encode_minimal(header), "</h1><p>", &encode_minimal(body), "</p><span class=bottom>Powered by KatWebX</span>"].concat())
}
pub fn http_error ( status : StatusCode , header : & str , body : & str , smaller : bool ) -> HttpResponse { let head = if smaller { HEADSPL } else { HEAD } ; HttpResponse :: Ok ( ) . status ( status ) . encoding ( ContentEncoding :: Auto ) . if_true ( status == StatusCode :: UNAUTHORIZED , | builder | { builder . header ( header :: WWW_AUTHENTICATE , " \" \" " ) ; } ) . header ( header :: SERVER , " " ) . content_type ( " " ) . body ( [ head , " " , header , " " , ERRSVG , & encode_minimal ( header ) , " " , & encode_minimal ( body ) , " " ] . concat ( ) ) }
http_error generates a server HTTP error page, using the provided data.
http_error generates a server HTTP error page using the provided data .
status
StatusCode
header
&str
body
&str
smaller
bool
status
StatusCode
header
&str
body
&str
smaller
bool