Commit 8b12263d authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Fix mg_http_send_redirect doc

PUBLISHED_FROM=77cd3df9959b0e3a2550d1581586e69878bbee0d
parent 376d2666
...@@ -13,12 +13,8 @@ Sends a redirect response. ...@@ -13,12 +13,8 @@ Sends a redirect response.
new location. new location.
If `extra_headers` is not empty, then `extra_headers` are also sent If `extra_headers` is not empty, then `extra_headers` are also sent
after the reponse line. `extra_headers` must NOT end end with new line. after the reponse line. `extra_headers` must NOT end end with new line.
Example:
mg_send_response_line(nc, 200, "Access-Control-Allow-Origin: *");
Will result in: Example:
HTTP/1.1 200 OK\r\n mg_http_send_redirect(nc, 302, mg_mk_str("/login"), mg_mk_str(NULL));
Access-Control-Allow-Origin: *\r\n
...@@ -2814,14 +2814,10 @@ void mg_send_response_line(struct mg_connection *nc, int status_code, ...@@ -2814,14 +2814,10 @@ void mg_send_response_line(struct mg_connection *nc, int status_code,
* new location. * new location.
* If `extra_headers` is not empty, then `extra_headers` are also sent * If `extra_headers` is not empty, then `extra_headers` are also sent
* after the reponse line. `extra_headers` must NOT end end with new line. * after the reponse line. `extra_headers` must NOT end end with new line.
* Example:
*
* mg_send_response_line(nc, 200, "Access-Control-Allow-Origin: *");
* *
* Will result in: * Example:
* *
* HTTP/1.1 200 OK\r\n * mg_http_send_redirect(nc, 302, mg_mk_str("/login"), mg_mk_str(NULL));
* Access-Control-Allow-Origin: *\r\n
*/ */
void mg_http_send_redirect(struct mg_connection *nc, int status_code, void mg_http_send_redirect(struct mg_connection *nc, int status_code,
const struct mg_str location, const struct mg_str location,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment