diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-16 13:06:05 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-16 13:06:05 +0000 |
commit | 1341b6bfbea28028eb12d833beeebc60c10dc00e (patch) | |
tree | 1f5108336ce963a1a0e3c3a54fdc806c4b9308a9 /src/plugins | |
parent | 0dc7abc2a99dc5ce799b7d26d0a727554c006de3 (diff) | |
download | rspamd-1341b6bfbea28028eb12d833beeebc60c10dc00e.tar.gz rspamd-1341b6bfbea28028eb12d833beeebc60c10dc00e.zip |
Do not rewrite the original url when using redirector
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/surbl.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index ca0986a71..f3f09c29b 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -985,6 +985,7 @@ surbl_redirector_finish (struct rspamd_http_connection *conn, struct redirector_param *param = (struct redirector_param *)conn->ud; struct rspamd_task *task; gint r, urllen; + struct rspamd_url *redirected_url; const rspamd_ftok_t *hdr; gchar *urlstr; @@ -1001,19 +1002,24 @@ surbl_redirector_finish (struct rspamd_http_connection *conn, struri (param->url), hdr); urllen = hdr->len; - urlstr = rspamd_mempool_alloc (param->task->task_pool, + urlstr = rspamd_mempool_alloc (task->task_pool, urllen + 1); + redirected_url = rspamd_mempool_alloc (task->task_pool, + sizeof (*redirected_url)); rspamd_strlcpy (urlstr, hdr->begin, urllen + 1); - r = rspamd_url_parse (param->url, urlstr, urllen, - param->task->task_pool); + r = rspamd_url_parse (redirected_url, urlstr, urllen, + task->task_pool); if (r == URI_ERRNO_OK) { - make_surbl_requests (param->url, + make_surbl_requests (redirected_url, param->task, param->suffix, FALSE, param->tree); } + else { + msg_info_task ("cannot parse redirector reply: %s", urlstr); + } } } else { |