1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

luahost: add type check TODOs (#436)

Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
James Hillyerd
2023-11-13 13:26:41 -08:00
committed by GitHub
parent d304cbd88b
commit 1088ccb8d1
2 changed files with 2 additions and 0 deletions

View File

@@ -116,6 +116,7 @@ func inboundMessageNewIndex(ls *lua.LState) int {
to := make([]mail.Address, 0, 16)
lt.ForEach(func(k, lv lua.LValue) {
if ud, ok := lv.(*lua.LUserData); ok {
// TODO should fail if wrong type + test.
if entry, ok := unwrapMailAddress(ud); ok {
to = append(to, *entry)
}

View File

@@ -99,6 +99,7 @@ func messageMetadataNewIndex(ls *lua.LState) int {
to := make([]*mail.Address, 0, 16)
lt.ForEach(func(k, lv lua.LValue) {
if ud, ok := lv.(*lua.LUserData); ok {
// TODO should fail if wrong type + test.
if entry, ok := unwrapMailAddress(ud); ok {
to = append(to, entry)
}