In my email worker, I would like to get all values for a given header, for example, the “to” or “cc” headers. Currently, the worker is returning only the first value for a given header.
Notes: We are assuming that the “cc” is not null. Also, the below refers to what has been observed with actual emails; the issue does not occur in the code editor’s console.
Example headers of an email processed by the worker:
to: A, B
cc: C, D
Example email worker code:
let to = message.headers.get("to"); let cc = message.headers.get("cc"); console.log(to, cc);
"A, B, C, D"
Thank you in advance