Refactored http default error document
This commit is contained in:
53
src/http.h
53
src/http.h
@ -111,7 +111,7 @@ http_error_msg http_error_messages[] = {
|
||||
{505, "The server does not support, or refuses to support, the HTTP protocol version that was used in the request message."}
|
||||
};
|
||||
|
||||
const char *http_error_document =
|
||||
const char *http_default_document =
|
||||
"<!DOCTYPE html>\n"
|
||||
"<html lang=\"en\">\n"
|
||||
"<head>\n"
|
||||
@ -119,53 +119,28 @@ const char *http_error_document =
|
||||
" <meta charset=\"UTF-8\"/>\n"
|
||||
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n"
|
||||
" <style>\n"
|
||||
" html {\n"
|
||||
" font-family: \"Arial\", sans-serif;\n"
|
||||
" --error: #C00000;\n"
|
||||
" --info: #E0C000;\n"
|
||||
" --color: var(--%5$s);\n"
|
||||
" }\n"
|
||||
" body {\n"
|
||||
" background-color: #F0F0F0;\n"
|
||||
" margin: 0.5em;\n"
|
||||
" }\n"
|
||||
" main {\n"
|
||||
" max-width: 600px;\n"
|
||||
" margin: 2em auto;\n"
|
||||
" background-color: #FFFFFF;\n"
|
||||
" border: 1px solid var(--color);\n"
|
||||
" border-radius: 4px;\n"
|
||||
" padding: 1em 2em;\n"
|
||||
" }\n"
|
||||
" h1, h2, h3, h4, h5, h6, h7 {\n"
|
||||
" text-align: center;\n"
|
||||
" color: var(--color);\n"
|
||||
" }\n"
|
||||
" h1 {\n"
|
||||
" margin: 0.5em 0;\n"
|
||||
" font-size: 1.5em;\n"
|
||||
" }\n"
|
||||
" p {\n"
|
||||
" text-align: center;\n"
|
||||
" }\n"
|
||||
" div.footer {\n"
|
||||
" color: #808080;\n"
|
||||
" font-size: 0.75em;\n"
|
||||
" text-align: center;\n"
|
||||
" margin: 0.5em 0;\n"
|
||||
" }\n"
|
||||
" html {font-family: \"Arial\", sans-serif; --error: #C00000; --info: #E0C000; --color: var(--%4$s);}\n"
|
||||
" body {background-color: #F0F0F0; margin: 0.5em;}\n"
|
||||
" main {max-width: 600px; margin: 2em auto; background-color: #FFFFFF; border: 1px solid var(--color); border-radius: 4px; padding: 1em 2em;}\n"
|
||||
" h1, h2, h3, h4, h5, h6, h7 {text-align: center;color: var(--color);}\n"
|
||||
" h1 {margin: 0.5em 0; font-size: 1.5em;}\n"
|
||||
" p {text-align: center;}\n"
|
||||
" div.footer {color: #808080; font-size: 0.75em; text-align: center; margin: 0.5em 0;}\n"
|
||||
" </style>\n"
|
||||
"</head>\n"
|
||||
"<body>\n"
|
||||
" <main>\n"
|
||||
" <h1>%1$i %2$s</h1>\n"
|
||||
" <p>%3$s</p>\n"
|
||||
" <p>%4$s</p>\n"
|
||||
"%3$s"
|
||||
" <div class=\"footer\">Necronda web server " NECRONDA_VERSION "</div>\n"
|
||||
" </main>\n"
|
||||
"</body>\n"
|
||||
"</html>\n";
|
||||
|
||||
const char *http_error_document =
|
||||
" <h1>%1$i %2$s :(</h1>\n"
|
||||
" <p>%3$s</p>\n"
|
||||
" <p>%4$s</p>\n";
|
||||
|
||||
|
||||
void http_to_camel_case(char *str);
|
||||
|
||||
|
Reference in New Issue
Block a user