diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-04-21 16:48:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-04-21 16:48:32 +0100 |
commit | ea6b0baf7a349c4ca41b4bf41bed3c7764f414cf (patch) | |
tree | ae80f8734c73b4892f56a94a852d47d848a1b9c4 /utils | |
parent | 5ce6980be276909ad4dc53398c746432c0a6e4ff (diff) | |
download | rspamd-ea6b0baf7a349c4ca41b4bf41bed3c7764f414cf.tar.gz rspamd-ea6b0baf7a349c4ca41b4bf41bed3c7764f414cf.zip |
Do not store redirects to the same url.
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/redirector.pl.in | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/redirector.pl.in b/utils/redirector.pl.in index b33886824..232921d5b 100755 --- a/utils/redirector.pl.in +++ b/utils/redirector.pl.in @@ -193,10 +193,13 @@ sub memcached_check_url { # Write url to memcached key sub memcached_cache_url { my ( $url, $url_real ) = @_; + + if ($url ne $url_real) { + my $context = Digest->new("SHA-256"); - my $context = Digest->new("SHA-256"); - - $memd->set(unpack("H*", ($context->hash($url))), $url_real, $cfg{cache_expire}); + $memd->set(unpack("H*", ($context->hash($url))), $url_real, + $cfg{cache_expire}); + } } # POE http client callback |