rabbit_mgmt_http_SUITE: Percent-encode `^` in URLs

This character is neither reserved nor unreserved and thus is an unsafe
character according to RFC 1738 and RFC 3986. Therefore it should be
percent-encoded.

Many implementations accept and/or produce URLs with raw `^`. However,
the URI parser in Erlang 21 is strict and will refuse that character.
Therefore, we now percent-encode it in the testsuite.

[#157964874]
This commit is contained in:
Jean-Sébastien Pédron 2018-06-12 11:39:20 +02:00
parent 673c6135cf
commit daf3811cdc
1 changed files with 2 additions and 2 deletions

View File

@ -1780,7 +1780,7 @@ exchanges_pagination_test(Config) ->
RegExByName = http_get(Config,
"/exchanges?page=1&page_size=2&name=^(?=^reg)&use_regex=true",
"/exchanges?page=1&page_size=2&name=%5E(?=%5Ereg)&use_regex=true",
?OK),
?assertEqual(Total, maps:get(total_count, RegExByName)),
?assertEqual(1, maps:get(filtered_count, RegExByName)),
@ -1922,7 +1922,7 @@ queue_pagination_test(Config) ->
], maps:get(items, ByName)),
RegExByName = http_get(Config,
"/queues?page=1&page_size=2&name=^(?=^reg)&use_regex=true",
"/queues?page=1&page_size=2&name=%5E(?=%5Ereg)&use_regex=true",
?OK),
?assertEqual(Total, maps:get(total_count, RegExByName)),
?assertEqual(1, maps:get(filtered_count, RegExByName)),