]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http: fix typos in previous patch
authorWilly Tarreau <w@1wt.eu>
Tue, 17 Jun 2014 16:58:26 +0000 (18:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Jun 2014 17:03:56 +0000 (19:03 +0200)
When I renamed the modify-header action to replace-value, one of them
was mistakenly set to "replace-val" instead. Additionally, differentiation
of the two actions must be done on args[0][8] and not *args[8]. Thanks
Thierry for spotting...

src/proto_http.c

index 568b91b0075dfb4cfcbbaf132e7cd78417839ca4..572739db4c5cb0873036816a80a1960c12110854 100644 (file)
@@ -9066,8 +9066,8 @@ struct http_req_rule *parse_http_req_cond(const char **args, const char *file, i
                proxy->conf.lfs_file = strdup(proxy->conf.args.file);
                proxy->conf.lfs_line = proxy->conf.args.line;
                cur_arg += 2;
-       } else if (strcmp(args[0], "replace-header") == 0 || strcmp(args[0], "replace-val") == 0) {
-               rule->action = *args[8] == 'h' ? HTTP_REQ_ACT_REPLACE_HDR : HTTP_REQ_ACT_REPLACE_VAL;
+       } else if (strcmp(args[0], "replace-header") == 0 || strcmp(args[0], "replace-value") == 0) {
+               rule->action = args[0][8] == 'h' ? HTTP_REQ_ACT_REPLACE_HDR : HTTP_REQ_ACT_REPLACE_VAL;
                cur_arg = 1;
 
                if (!*args[cur_arg] || !*args[cur_arg+1] || !*args[cur_arg+2] ||
@@ -9421,7 +9421,7 @@ struct http_res_rule *parse_http_res_cond(const char **args, const char *file, i
                proxy->conf.lfs_line = proxy->conf.args.line;
                cur_arg += 2;
        } else if (strcmp(args[0], "replace-header") == 0 || strcmp(args[0], "replace-value") == 0) {
-               rule->action = *args[8] == 'h' ? HTTP_RES_ACT_REPLACE_HDR : HTTP_RES_ACT_REPLACE_VAL;
+               rule->action = args[0][8] == 'h' ? HTTP_RES_ACT_REPLACE_HDR : HTTP_RES_ACT_REPLACE_VAL;
                cur_arg = 1;
 
                if (!*args[cur_arg] || !*args[cur_arg+1] || !*args[cur_arg+2] ||