]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Use shorter keys for url redirections
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Jun 2017 09:52:07 +0000 (10:52 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Jun 2017 09:52:07 +0000 (10:52 +0100)
src/plugins/lua/url_redirector.lua

index 2ba645f19b6a5824a1caeb4af07e0250576cae12..1c1c68808f5f5986de280e17a657ee9450a82888 100644 (file)
@@ -171,7 +171,8 @@ end
 
 local function url_redirector_handler(task, url, param)
   local url_str = tostring(url)
-  local key = settings.key_prefix .. hash.create(url_str):base32()
+  -- 32 base32 characters are roughly 20 bytes of data or 160 bits
+  local key = settings.key_prefix .. hash.create(url_str):base32():sub(1, 32)
   resolve_cached(task, url_str, url_str, key, param, 1)
 end