-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.hpp
69 lines (64 loc) · 1.59 KB
/
constants.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include<string>
#define CRLF (std::string("\r\n"))
#define CRLFCRLF (std::string("\r\n\r\n"))
#define VERSION (std::string("HTTP/1.1"))
#define WHITESPACE (std::string("\r\n\t "))
#define HTML_FOOTER \
" </pre>\n" \
" <hr>\n" \
" </body>\n" \
"</html>\n"
#define E_UNKNOWN_DIRECTIVE (std::string("Unknown directive"))
#define E_DUPLICATE_DIRECTIVE (std::string("Duplicate directive"))
#define E_WRONG_CONTEXT (std::string("Directive is not allowed in this context"))
#define E_UNKNOWN_ARGUMENT (std::string("Unknown argument for directive"))
#define E_BLOCK_NOT_CLOSED (std::string("Unclosed block for directive"))
#define E_INCORRECT_FORMAT (std::string("Incorrectly formatted line"))
#define E_MISSING_DIRECTIVE (std::string("Expected directive is missing"))
const static std::string DEFAULT_ERR_PAGE = R"(
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Error</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
margin: 0;
padding: 0;
}
.container {
max-width: 600px;
margin: 50px auto;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
h1 {
color: #e002fd;
}
p {
margin-bottom: 20px;
}
a {
color: #007bff;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<h1>Oops!</h1>
<p>There was an error processing your request.</p>
</div>
</body>
</html>
)";