summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/html-error.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/html-error.c b/src/html-error.c
index 860e424..c6b580e 100644
--- a/src/html-error.c
+++ b/src/html-error.c
@@ -193,24 +193,31 @@ send_http_error_message(struct conn_s *connptr)
FILE *infile;
int ret;
char *fallback_error =
- "<html><head><title>%s</title></head>"
- "<body><blockquote><i>%s %s</i><br>"
- "The page you requested was unavailable. The error code is listed "
- "below. In addition, the HTML file which has been configured as the "
- "page to be displayed when an error of this type was unavailable, "
- "with the error code %d (%s). Please contact your administrator."
- "<center>%s</center>" "</body></html>" "\r\n";
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
+ "<html>\n"
+ "<head><title>%d %s</title></head>\n"
+ "<body>\n"
+ "<h1>%s</h1>\n"
+ "<p>%s</p>\n"
+ "<hr />\n"
+ "<p><em>Generated by %s version %s.</em></p>\n"
+ "</body>\n"
+ "</html>\n";
send_http_headers(connptr, connptr->error_number,
connptr->error_string);
error_file = get_html_file(connptr->error_number);
- if (!(infile = fopen(error_file, "r")))
+ if (!(infile = fopen(error_file, "r"))) {
+ char *detail = lookup_variable(connptr, "detail");
return (write_message(connptr->client_fd, fallback_error,
+ connptr->error_number,
connptr->error_string,
- PACKAGE, VERSION,
- errno, strerror(errno),
- connptr->error_string));
+ connptr->error_string,
+ detail,
+ PACKAGE, VERSION));
+ }
ret = send_html_file(infile, connptr);
fclose(infile);