Use Context.FormParams

This commit is contained in:
Simon Ser 2019-12-17 13:09:25 +01:00
parent e2d70ba6ca
commit 38d73f5771
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -347,6 +347,7 @@ func handleCompose(ectx echo.Context) error {
}
// TODO: append to IMAP Sent mailbox
// TODO: add \Answered flag to original IMAP message
return ctx.Redirect(http.StatusFound, "/mailbox/INBOX")
}
@ -439,10 +440,11 @@ func handleSetFlags(ectx echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, err)
}
if err := ctx.Request().ParseForm(); err != nil {
form, err := ctx.FormParams()
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, err)
}
flags, ok := ctx.Request().Form["flags"]
flags, ok := form["flags"]
if !ok {
return echo.NewHTTPError(http.StatusBadRequest, "missing 'flags' form values")
}