mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-15 19:32:12 +02:00
[MEDIUM] add support for conditional HTTP redirection
A new "redirect" keyword adds the ability to send an HTTP 301/302/303 redirection to either an absolute location or to a prefix followed by the original URI. The redirection is conditionned by ACL rules, so it becomes very easy to move parts of a site to another site using this. This work was almost entirely done at Exceliance by Emeric Brun. A test-case has been added in the tests/ directory.
This commit is contained in:
@@ -648,6 +648,7 @@ void deinit(void)
|
||||
struct hdr_exp *exp, *expb;
|
||||
struct acl *acl, *aclb;
|
||||
struct switching_rule *rule, *ruleb;
|
||||
struct redirect_rule *rdr, *rdrb;
|
||||
struct uri_auth *uap, *ua = NULL;
|
||||
struct user_auth *user;
|
||||
int i;
|
||||
@@ -758,6 +759,14 @@ void deinit(void)
|
||||
free(rule);
|
||||
}
|
||||
|
||||
list_for_each_entry_safe(rdr, rdrb, &p->redirect_rules, list) {
|
||||
LIST_DEL(&rdr->list);
|
||||
prune_acl_cond(rdr->cond);
|
||||
free(rdr->cond);
|
||||
free(rdr->rdr_str);
|
||||
free(rdr);
|
||||
}
|
||||
|
||||
if (p->appsession_name)
|
||||
free(p->appsession_name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user