Do not prefix successfulresponse with "Error: "

It's confusing

PUBLISHED_FROM=9158ccd920dabf92963e76aa96a988753b9c427d
This commit is contained in:
Deomid Ryabkov 2017-02-13 14:58:51 +00:00 committed by Cesanta Bot
parent 383b2a48c5
commit d6d956b9d8

View File

@ -36,8 +36,9 @@ static void s3_handler(struct mg_connection *nc, int ev, void *ev_data) {
switch (ev) { switch (ev) {
case MG_EV_HTTP_REPLY: case MG_EV_HTTP_REPLY:
if (nc2 != NULL) { if (nc2 != NULL) {
mg_printf_http_chunk(nc2, "Error: %.*s", (int) hm->message.len, mg_printf_http_chunk(nc2, "%s%.*s",
hm->message.p); (hm->resp_code == 200 ? "" : "Error: "),
(int) hm->message.len, hm->message.p);
mg_send_http_chunk(nc2, "", 0); mg_send_http_chunk(nc2, "", 0);
} }
unlink_conns(nc); unlink_conns(nc);