]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] protocol: Pass v3 Content-Type as mime_type parameter
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 7 Feb 2026 15:54:55 +0000 (15:54 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 7 Feb 2026 15:54:55 +0000 (15:54 +0000)
commit4006bcdb9d6c020057232e4a3e12ebfabf2b24f8
tree32c12eab3c2e8e8166a2f2440360f1af84272c10
parenteef07b16d3753d45492a5921fa0ba64acbe98006
[Fix] protocol: Pass v3 Content-Type as mime_type parameter

The v3 reply builder was adding Content-Type (multipart/mixed with
boundary) as an HTTP header via rspamd_http_message_add_header, while
setting ctype=NULL for rspamd_http_connection_write_message. With NULL,
the HTTP library defaults to "text/plain", so the client never saw the
multipart Content-Type and fell through to plain UCL parsing.

Fix by returning the Content-Type string (pool-allocated) from
rspamd_protocol_http_reply_v3 and passing it as the mime_type parameter
directly. Also fix the same pattern in rspamd_proxy.c.

Update v3 error test expectations from 400 to 500 to match the existing
error code mapping formula (500 + err_code % 100).
src/libserver/protocol.c
src/libserver/protocol.h
src/rspamd_proxy.c
test/functional/cases/001_merged/430_checkv3.robot