On Tue, 11 Apr 2006 20:50:01 +0000 (UTC) "Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum" 10353@lyskom.lysator.liu.se wrote:
You should use \0-separated strings to provide multiple values for a header. This is also what you get if you parse a string with multiple values for a header:
Pike v7.6 release 68 running Hilfe v3.5 (Incremental Pike Frontend)
MIME.Message("Received: foo\r\nReceived: bar\r\n\r\nHej")->headers;
(1) Result: ([ /* 1 element */ "received": "foo\0bar" ])
(string)MIME.Message("baz", (["received":"foo\0bar"]));
(2) Result: "Content-Length: 3\r\nReceived: foo\r\nReceived: bar\r\n\r\nbaz"
Ok, in that case the bug is in the create() method. It specifically allows: MIME.Message("baz", (["received":({"foo","bar"})]));
It also seems like an array of strings makes more sense than a single NULL delimited string. Should we change the constructor to convert arrays into NULL delimited strings, or vice versa?
Adam