diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2013-05-07 16:31:26 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2013-05-07 16:31:26 +0100 |
| commit | 79005d6a9394cc40e3700331614669cad90c0939 (patch) | |
| tree | 72cfa276cb21f30707c66ea07043f09da2be5baa | |
| parent | 3c717c4ed24f7d0b398f46edaf4cbb457a1dcdac (diff) | |
| download | rabbitmq-server-git-79005d6a9394cc40e3700331614669cad90c0939.tar.gz | |
Treat missing / garbled x-match header as "all", like we used to.
| -rw-r--r-- | src/rabbit_exchange_type_headers.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rabbit_exchange_type_headers.erl b/src/rabbit_exchange_type_headers.erl index cf2d314079..44f909ebba 100644 --- a/src/rabbit_exchange_type_headers.erl +++ b/src/rabbit_exchange_type_headers.erl @@ -67,8 +67,9 @@ validate_binding(_X, #binding{args = Args}) -> {binding_invalid, "x-match field missing", []}} end. -parse_x_match(<<"all">>) -> all; -parse_x_match(<<"any">>) -> any. +parse_x_match({longstr, <<"all">>}) -> all; +parse_x_match({longstr, <<"any">>}) -> any; +parse_x_match(_) -> all. %% legacy; we didn't validate %% Horrendous matching algorithm. Depends for its merge-like %% (linear-time) behaviour on the lists:keysort @@ -80,8 +81,8 @@ parse_x_match(<<"any">>) -> any. %% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %% headers_match(Args, Data) -> - {longstr, MK} = rabbit_misc:table_lookup(Args, <<"x-match">>), - headers_match(Args, Data, true, false, parse_x_match(MK)). + MK = parse_x_match(rabbit_misc:table_lookup(Args, <<"x-match">>)), + headers_match(Args, Data, true, false, MK). headers_match([], _Data, AllMatch, _AnyMatch, all) -> AllMatch; |
