MINOR: http-htx: Add a new section to create groups of custom HTTP errors
A new section may now be declared in the configuration to create global groups
of HTTP errors. These groups are not linked to a proxy and are referenced by
name. The section must be declared using the keyword "http-errors" followed by
the group name. This name must be unique. A list of "errorfile" directives may
be declared in such section. For instance:
http-errors website-1
errorfile 400 /path/to/site1/400.http
errorfile 404 /path/to/site1/404.http
http-errors website-2
errorfile 400 /path/to/site2/400.http
errorfile 404 /path/to/site2/404.http
For now, it is just possible to create "http-errors" sections. There is no
documentation because these groups are not used yet.
diff --git a/include/types/http_htx.h b/include/types/http_htx.h
index d9c3052..4c49b25 100644
--- a/include/types/http_htx.h
+++ b/include/types/http_htx.h
@@ -26,6 +26,7 @@
#include <ebistree.h>
#include <common/buf.h>
+#include <common/http.h>
#include <common/htx.h>
#include <common/ist.h>
@@ -45,4 +46,16 @@
struct ebpt_node node;
};
+/* http-errors section and parameters. */
+struct http_errors {
+ char *id; /* unique identifier */
+ struct {
+ char *file; /* file where the section appears */
+ int line; /* line where the section appears */
+ } conf; /* config information */
+
+ struct buffer *errmsg[HTTP_ERR_SIZE]; /* customized error messages for known errors */
+ struct list list; /* http-errors list */
+};
+
#endif /* _TYPES_HTTP_HTX_H */