aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_util.lua
diff options
context:
space:
mode:
authorTarmo Oja <tarmo.oja@cyber.ee>2024-09-04 12:07:12 +0300
committerTarmo Oja <tarmo.oja@cyber.ee>2024-09-04 12:07:12 +0300
commit2c1114598c49d853f645376a26f5c7276875d2fe (patch)
tree29c379538fc0a627e50a9459e6daf43b16cf8f61 /lualib/lua_util.lua
parent4b1eab46c1f6466262637d44872a8e9053bb686d (diff)
downloadrspamd-2c1114598c49d853f645376a26f5c7276875d2fe.tar.gz
rspamd-2c1114598c49d853f645376a26f5c7276875d2fe.zip
deduplicate url_encode_string
Diffstat (limited to 'lualib/lua_util.lua')
-rw-r--r--lualib/lua_util.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua
index 88599407c..470925b95 100644
--- a/lualib/lua_util.lua
+++ b/lualib/lua_util.lua
@@ -1708,6 +1708,9 @@ local function url_encode_string(str)
end
exports.url_encode_string = url_encode_string
+assert(url_encode_string('上海+中國') == '%E4%B8%8A%E6%B5%B7%2B%E4%B8%AD%E5%9C%8B')
+assert(url_encode_string('? and the Mysterians') == '%3F+and+the+Mysterians')
+
-- Short unit test for sanity
if path_sep == '/' then
assert(join_path('/path', 'to', 'file') == '/path/to/file')