Fix bad request handling

This commit is contained in:
Ilja Kartašov 2019-04-25 14:18:29 +02:00
parent dc52c20098
commit e3e84a0441
1 changed files with 4 additions and 1 deletions

View File

@ -132,8 +132,10 @@ on_stream_request(AxFeedback mod, const struct aisl_evt *evt)
AislStream s = (AislStream)evt->source;
/* verify input */
if (!ctx->email || !ctx->msg || ax_validate_email(ctx->email) != 0)
if (!ctx->email || !ctx->msg || ax_validate_email(ctx->email) != 0) {
ax_quick_response(s, AISL_HTTP_BAD_REQUEST);
goto finally;
}
ctx->mail.reply_to = ctx->email;
ctx->mail.msg = ctx->msg;
@ -144,6 +146,7 @@ on_stream_request(AxFeedback mod, const struct aisl_evt *evt)
aisl_set_output_event(s, true); /**< enable output event */
finally:
return AISL_SUCCESS;
}