Skip to content

Commit

Permalink
feat: add ClamAV result descr as X-Virus-ID header
Browse files Browse the repository at this point in the history
Signed-off-by: Khaled Emara <mail@KhaledEmara.dev>
  • Loading branch information
KhaledEmaraDev committed Apr 12, 2023
1 parent 9cb80eb commit db85381
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions service/services/clamav/clamav.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ func (c *Clamav) Processing(partial bool, IcapHeader textproto.MIMEHeader) (int,
msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}
req.Body = io.NopCloser(htmlPage)
serviceHeaders["X-Virus-ID"] = result.Description
msgHeadersAfterProcessing = c.generalFunc.LogHTTPMsgHeaders(c.methodName)
return utils.OkStatusCodeStr, req, serviceHeaders,
msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
Expand Down

1 comment on commit db85381

@idavollen
Copy link

@idavollen idavollen commented on db85381 Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello, as I commented on my original issue, #133 for returning the detected virus info back to the ICAP client, it might be even better to make this custom response header configurable in the config.toml file, for instance, our WAF expects to receive X-Virus-Name in response header for detected virus in the uploaded file, using this hard coded X-Virus-ID as fallback only when nothing is specified in the config.toml file

Please sign in to comment.