mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-22 18:50:37 +01:00
Add error handling for unknown content types in eml.go
The update adds a case to the switch clause in eml.go for properly handling unknown content types. An error will now be returned when the media type of the body to be parsed is not recognized, increasing the robustness of the system.
This commit is contained in:
parent
4c88dce2a8
commit
70c9387003
1 changed files with 1 additions and 0 deletions
1
eml.go
1
eml.go
|
@ -195,6 +195,7 @@ func parseEMLBodyParts(parsedMsg *netmail.Message, bodybuf *bytes.Buffer, msg *M
|
|||
return fmt.Errorf("failed to parse multipart body: %w", err)
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("failed to parse body, unknown content type: %s", mediatype)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue