Skip to content

Commit

Permalink
Merge pull request #4608 from lbahtarliev/master
Browse files Browse the repository at this point in the history
[Fix] Change Date: header location to conform with RFC
  • Loading branch information
vstakhov committed Sep 22, 2023
2 parents e49db79 + 313bda1 commit 74ef607
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lualib/lua_scanners/icap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ local function icap_check(task, content, digest, rule, maybe_part)

local in_client_ip = task:get_from_ip()
local req_hlen = 2
table.insert(req_headers, string.format('Date: %s\r\n', rspamd_util.time_to_string(rspamd_util.get_time())))
if maybe_part then
table.insert(req_headers, string.format('GET http://%s/%s HTTP/1.0\r\n', in_client_ip, maybe_part:get_filename()))
table.insert(http_headers, string.format('Content-Type: %s/%s\r\n', maybe_part:get_detected_type()))
else
table.insert(req_headers, string.format('GET %s HTTP/1.0\r\n', rule.req_fake_url))
table.insert(http_headers, string.format('Content-Type: application/octet-stream\r\n'))
end
table.insert(req_headers, string.format('Date: %s\r\n', rspamd_util.time_to_string(rspamd_util.get_time())))
if rule.user_agent ~= "none" then
table.insert(req_headers, string.format("User-Agent: %s\r\n", rule.user_agent))
end
Expand Down

0 comments on commit 74ef607

Please sign in to comment.