mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 03:26:37 +03:00
message: when parsing a message, don't treat absent header and empty header value the same
We now use "*string" for such header fields, for Content-* fields, as used in the imapserver when responding to FETCH commands. We'll now return NIL for an absent header, and "" (empty string) if the header value is empty.
This commit is contained in:
@ -34,11 +34,11 @@ func (t niltoken) xwriteTo(c *conn, xw io.Writer) {
|
||||
xw.Write([]byte(t.pack(c)))
|
||||
}
|
||||
|
||||
func nilOrString(s string) token {
|
||||
if s == "" {
|
||||
func nilOrString(s *string) token {
|
||||
if s == nil {
|
||||
return nilt
|
||||
}
|
||||
return string0(s)
|
||||
return string0(*s)
|
||||
}
|
||||
|
||||
type string0 string
|
||||
|
Reference in New Issue
Block a user