[MINOR] redirect: add support for the "drop-query" option
If "drop-query" is present on a "redirect" line using the "prefix" mode,
then the returned Location header will be the request URI without the
query-string. This may be used on some login/logout pages, or when it
must be decided to redirect the user to a non-secure server.
(cherry-picked from commit f2d361ccd73aa16538ce767c766362dd8f0a88fd)
diff --git a/include/types/proto_http.h b/include/types/proto_http.h
index c9a28f7..7313e25 100644
--- a/include/types/proto_http.h
+++ b/include/types/proto_http.h
@@ -165,7 +165,11 @@
DATA_ST_PX_FIN,
};
-
+/* Redirect flags */
+enum {
+ REDIRECT_FLAG_NONE = 0,
+ REDIRECT_FLAG_DROP_QS = 1, /* drop query string */
+};
/* Redirect types (location, prefix, extended ) */
enum {
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 721d7c0..a7d2c40 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -266,6 +266,7 @@
int rdr_len;
char *rdr_str;
int code;
+ unsigned int flags;
};
extern struct proxy *proxy;