-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Bug: MIME boundary value defaults to --LibAs2 prefix, producing 4-hyphen delimiters in message body
Package: @mistweaverco/libas2
Description
AS2MimeNode sets boundaryPrefix to '--LibAs2' by default. Because RFC 2046 requires each boundary delimiter in the body to be -- followed by the boundary value, the resulting delimiters start with ---- (4 hyphens) rather than the required -- (2 hyphens). Many AS2 trading partners reject these messages.
Steps to reproduce
import { AS2Composer } from '@mistweaverco/libas2'
const composer = new AS2Composer({
message: { filename: 'message.xml', contentType: 'application/xml', content: Buffer.from('<test/>') },
agreement: {
host: { name: 'Host', id: 'HOST', url: 'http://host/as2', sign: 'sha-256', certificate: HOST_CERT, privateKey: HOST_KEY },
partner: { name: 'Partner', id: 'PARTNER', url: 'http://partner/as2', encrypt: false },
},
})
const { headers, body } = await (await composer.compile()).buildObject()
console.log(headers['Content-Type'])
// multipart/signed; boundary="--LibAs2-abc123-Part_1" ← boundary value starts with '--'
console.log(body.split('\n')[0])
// ----LibAs2-abc123-Part_1 ← delimiter has 4 hyphensReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels