MEDIUM: stats: proxied stats admin forms fix

Patch for not using relative URLs for admin forms. This allows proxied instances
of the stats admin interface to continue to function, as the default FORM
action is to submit to the current URL.
This commit is contained in:
Jeff Buchbinder 2014-08-29 15:10:08 -05:00 committed by Willy Tarreau
parent 2c701b5f3b
commit 2dbbf4db85

View File

@ -3630,11 +3630,7 @@ static void stats_dump_html_px_hdr(struct stream_interface *si, struct proxy *px
}
chunk_appendf(&trash,
"<form action=\"%s%s%s%s\" method=\"post\">",
uri->uri_prefix,
(appctx->ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "",
(appctx->ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "",
scope_txt);
"<form method=\"post\">");
}
/* print a new table */
@ -4138,10 +4134,7 @@ static void stats_dump_html_info(struct stream_interface *si, struct uri_auth *u
scope_txt[appctx->ctx.stats.scope_len] = '\0';
chunk_appendf(&trash,
"<li><form method=\"GET\" action=\"%s%s%s\">Scope : <input value=\"%s\" name=\"" STAT_SCOPE_INPUT_NAME "\" size=\"8\" maxlength=\"%d\" tabindex=\"1\"/></form>\n",
uri->uri_prefix,
(appctx->ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "",
(appctx->ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "",
"<li><form method=\"GET\">Scope : <input value=\"%s\" name=\"" STAT_SCOPE_INPUT_NAME "\" size=\"8\" maxlength=\"%d\" tabindex=\"1\"/></form>\n",
(appctx->ctx.stats.scope_len > 0) ? scope_txt : "",
STAT_SCOPE_TXT_MAXLEN);