Update rev proxy error document handling
This commit is contained in:
13
src/client.c
13
src/client.c
@ -561,12 +561,15 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int
|
|||||||
const http_doc_info *info = http_get_status_info(res.status);
|
const http_doc_info *info = http_get_status_info(res.status);
|
||||||
const http_status_msg *http_msg = http_get_error_msg(res.status);
|
const http_status_msg *http_msg = http_get_error_msg(res.status);
|
||||||
|
|
||||||
if (res.status->code >= 300 && res.status->code < 400 && msg_content[0] == 0) {
|
if (msg_content[0] == 0) {
|
||||||
const char *location = http_get_header_field(&res.hdr, "Location");
|
if (res.status->code >= 300 && res.status->code < 400) {
|
||||||
if (location != NULL) {
|
const char *location = http_get_header_field(&res.hdr, "Location");
|
||||||
snprintf(msg_content, sizeof(msg_content),
|
if (location != NULL) {
|
||||||
"<ul>\n\t<li><a href=\"%1$s\">%1$s</a></li>\n</ul>\n", location);
|
snprintf(msg_content, sizeof(msg_content), "<ul>\n\t<li><a href=\"%1$s\">%1$s</a></li>\n</ul>\n", location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else if (strncmp(msg_content, "<!DOCTYPE html>", 15) == 0 || strncmp(msg_content, "<html", 5) == 0) {
|
||||||
|
msg_content[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *rev_proxy_doc = "";
|
char *rev_proxy_doc = "";
|
||||||
|
Reference in New Issue
Block a user