CLEANUP: http: Remove unused HTTP message templates
HTTP_1XX, HTTP_3XX and HTTP_4XX message templates are no longer used. Only
HTTP_302 and HTTP_303 are used during configuration parsing by "errorloc" family
directives. So these templates are removed from the generic http code. And
HTTP_302 and HTTP_303 templates are moved as static strings in the function
parsing "errorloc" directives.
diff --git a/src/http_htx.c b/src/http_htx.c
index 3137fbe..7211a4d 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -1223,6 +1223,17 @@
*/
struct buffer *http_parse_errorloc(int errloc, int status, const char *url, char **errmsg)
{
+ static const char *HTTP_302 =
+ "HTTP/1.1 302 Found\r\n"
+ "Cache-Control: no-cache\r\n"
+ "Content-length: 0\r\n"
+ "Location: "; /* not terminated since it will be concatenated with the URL */
+ static const char *HTTP_303 =
+ "HTTP/1.1 303 See Other\r\n"
+ "Cache-Control: no-cache\r\n"
+ "Content-length: 0\r\n"
+ "Location: "; /* not terminated since it will be concatenated with the URL */
+
struct buffer *buf = NULL;
const char *msg;
char *key = NULL, *err = NULL;