Add mg_http_send_redirect and make examples use it

PUBLISHED_FROM=f45e06aeba1c00212078d539b6f74cb8bd054326
This commit is contained in:
Deomid Ryabkov authored and Cesanta Bot committed 2016-09-30 11:22:00 +00:00
1 parent 8f522048d8
commit 460d95afc5
12 files changed
+119 -41

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ static void handle_save(struct mg_connection *nc, struct http_message *hm) {
sizeof(s_settings.setting2));
// Send response
mg_printf(nc, "%s", "HTTP/1.1 302 OK\r\nLocation: /\r\n\r\n");
mg_http_send_redirect(nc, 302, mg_mk_str("/"), mg_mk_str(NULL));
}
static void handle_ssi_call(struct mg_connection *nc, const char *param) {