MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / attMultipart

Function attMultipart

internal/httpapi/attachment_endpoint_test.go:21–30  ·  view source on GitHub ↗

attMultipart: text body + base64 PDF (index 0) + named inline png (index 1).

()

Source from the content-addressed store, hash-verified

19
20// attMultipart: text body + base64 PDF (index 0) + named inline png (index 1).
21func attMultipart() []byte {
22 pdf := base64.StdEncoding.EncodeToString([]byte("%PDF-1.4 hello"))
23 png := base64.StdEncoding.EncodeToString([]byte("\x89PNG bytes"))
24 return []byte("From: a@x.com\r\nTo: support@acme.com\r\nSubject: hi\r\n" +
25 "Content-Type: multipart/mixed; boundary=B\r\n\r\n" +
26 "--B\r\nContent-Type: text/plain\r\n\r\nbody\r\n" +
27 "--B\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"report.pdf\"\r\nContent-Transfer-Encoding: base64\r\n\r\n" + pdf + "\r\n" +
28 "--B\r\nContent-Type: image/png\r\nContent-Disposition: inline; filename=\"logo.png\"\r\nContent-Transfer-Encoding: base64\r\n\r\n" + png + "\r\n" +
29 "--B--\r\n")
30}
31
32// attBig: one attachment whose DECODED size exceeds the 256 KB inline cap.
33func attBig() []byte {

Callers 1

attTestServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected