mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
Switch to storing To addresses as a slice
- Changes on-disk storage format - Changes JSON API - To and From values are now parsed/formatted by Go's mail.ParseAddress function - Fixed bug in list-entry-template, was not escaping HTML characters - Updated tests
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
type InputMessageData struct {
|
||||
Mailbox, ID, From, Subject string
|
||||
To string
|
||||
To []string
|
||||
Date time.Time
|
||||
Size int
|
||||
Header mail.Header
|
||||
@@ -81,8 +81,10 @@ func (d *InputMessageData) CompareToJSONHeaderMap(json interface{}) (errors []st
|
||||
if msg, ok := isJSONStringEqual(fromKey, d.From, m[fromKey]); !ok {
|
||||
errors = append(errors, msg)
|
||||
}
|
||||
if msg, ok := isJSONStringEqual(toKey, d.To, m[toKey]); !ok {
|
||||
errors = append(errors, msg)
|
||||
for i, inputTo := range d.To {
|
||||
if msg, ok := isJSONStringEqual(toKey, inputTo, m[toKey].([]interface{})[i]); !ok {
|
||||
errors = append(errors, msg)
|
||||
}
|
||||
}
|
||||
if msg, ok := isJSONStringEqual(subjectKey, d.Subject, m[subjectKey]); !ok {
|
||||
errors = append(errors, msg)
|
||||
|
||||
Reference in New Issue
Block a user