diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-02 11:35:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-02 11:36:28 +0100 |
commit | 31ef21901866b7b76755436646ab0ed2857815a1 (patch) | |
tree | 46ad73bfe7b1ee907d3c964ab715d5988953a71f /test/lua | |
parent | 689ed83366449fee3d783848cdb4fed6fbfabdc0 (diff) | |
download | rspamd-31ef21901866b7b76755436646ab0ed2857815a1.tar.gz rspamd-31ef21901866b7b76755436646ab0ed2857815a1.zip |
Add workarounds for numeric hosts in URLs.
Diffstat (limited to 'test/lua')
-rw-r--r-- | test/lua/unit/url.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test/lua/unit/url.lua b/test/lua/unit/url.lua index 4362a3999..9836ed127 100644 --- a/test/lua/unit/url.lua +++ b/test/lua/unit/url.lua @@ -65,7 +65,22 @@ context("URL check functions", function() }}, {"http://%25DOMAIN:foobar@foodomain.com/", true, { host = 'foodomain.com', user = '%25DOMAIN' - }} + }}, + {"http://0.0xFFFFFF", true, { + host = '0.255.255.255' + }}, + {"http://030052000001", true, { + host = '192.168.0.1' + }}, + {"http://0xc0.052000001", true, { + host = '192.168.0.1' + }}, + {"http://192.168.0.1.", true, { + host = '192.168.0.1' + }}, + {"http://[::eeee:192.168.0.1]", true, { + host = '::eeee:c0a8:1' + }}, } for _,c in ipairs(cases) do @@ -78,7 +93,7 @@ context("URL check functions", function() for k,v in pairs(c[3]) do assert_not_nil(uf[k], k .. ' is missing in url, must be ' .. v) - assert_equal(uf[k], v, 'expected ' .. v .. ' for ' .. k .. ' but got ' .. uf[k]) + assert_equal(uf[k], v, 'expected ' .. v .. ' for ' .. k .. ' but got ' .. uf[k] .. ' in url ' .. c[1]) end for k,v in pairs(uf) do if k ~= 'url' and k ~= 'protocol' and k ~= 'tld' then |