REORG: include: split common/http.h into haproxy/http{,-t}.h
So the enums and structs were placed into http-t.h and the functions
into http.h. This revealed that several files were dependeng on http.h
but not including it, as it was silently inherited via other files.
diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c
index fe2520d..a07727e 100644
--- a/contrib/prometheus-exporter/service-prometheus.c
+++ b/contrib/prometheus-exporter/service-prometheus.c
@@ -15,6 +15,7 @@
#include <haproxy/api.h>
#include <common/cfgparse.h>
+#include <haproxy/http.h>
#include <common/htx.h>
#include <haproxy/pool.h>
#include <haproxy/list.h>
diff --git a/include/common/h1.h b/include/common/h1.h
index 205a25c..7c341fe 100644
--- a/include/common/h1.h
+++ b/include/common/h1.h
@@ -25,7 +25,7 @@
#include <haproxy/api.h>
#include <haproxy/dynbuf.h>
#include <haproxy/intops.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <common/http-hdr.h>
#include <import/ist.h>
diff --git a/include/common/hpack-enc.h b/include/common/hpack-enc.h
index 7d73b35..ede8d28 100644
--- a/include/common/hpack-enc.h
+++ b/include/common/hpack-enc.h
@@ -31,7 +31,7 @@
#include <string.h>
#include <haproxy/api.h>
#include <haproxy/buf-t.h>
-#include <common/http.h>
+#include <haproxy/http-t.h>
#include <import/ist.h>
int hpack_encode_header(struct buffer *out, const struct ist n,
diff --git a/include/common/http.h b/include/common/http.h
deleted file mode 100644
index 0173b7a..0000000
--- a/include/common/http.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * include/common/http.h
- *
- * Version-agnostic and implementation-agnostic HTTP protocol definitions.
- *
- * Copyright (C) 2000-2018 Willy Tarreau - w@1wt.eu
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation, version 2.1
- * exclusively.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _COMMON_HTTP_H
-#define _COMMON_HTTP_H
-
-#include <haproxy/buf-t.h>
-#include <import/ist.h>
-
-/*
- * some macros mainly used when parsing header fields.
- * from RFC7230:
- * CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
- * SEP = one of the 17 defined separators or SP or HT
- * LWS = CR, LF, SP or HT
- * SPHT = SP or HT. Use this macro and not a boolean expression for best speed.
- * CRLF = CR or LF. Use this macro and not a boolean expression for best speed.
- * token = any CHAR except CTL or SEP. Use this macro and not a boolean expression for best speed.
- *
- * added for ease of use:
- * ver_token = 'H', 'P', 'T', '/', '.', and digits.
- */
-#define HTTP_FLG_CTL 0x01
-#define HTTP_FLG_SEP 0x02
-#define HTTP_FLG_LWS 0x04
-#define HTTP_FLG_SPHT 0x08
-#define HTTP_FLG_CRLF 0x10
-#define HTTP_FLG_TOK 0x20
-#define HTTP_FLG_VER 0x40
-#define HTTP_FLG_DIG 0x80
-
-#define HTTP_IS_CTL(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_CTL)
-#define HTTP_IS_SEP(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_SEP)
-#define HTTP_IS_LWS(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_LWS)
-#define HTTP_IS_SPHT(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_SPHT)
-#define HTTP_IS_CRLF(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_CRLF)
-#define HTTP_IS_TOKEN(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_TOK)
-#define HTTP_IS_VER_TOKEN(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_VER)
-#define HTTP_IS_DIGIT(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_DIG)
-
-/* Known HTTP methods */
-enum http_meth_t {
- HTTP_METH_OPTIONS,
- HTTP_METH_GET,
- HTTP_METH_HEAD,
- HTTP_METH_POST,
- HTTP_METH_PUT,
- HTTP_METH_DELETE,
- HTTP_METH_TRACE,
- HTTP_METH_CONNECT,
- HTTP_METH_OTHER, /* Must be the last entry */
-} __attribute__((packed));
-
-/* Known HTTP authentication schemes */
-enum ht_auth_m {
- HTTP_AUTH_WRONG = -1, /* missing or unknown */
- HTTP_AUTH_UNKNOWN = 0,
- HTTP_AUTH_BASIC,
- HTTP_AUTH_DIGEST,
-} __attribute__((packed));
-
-/* All implemented HTTP status codes */
-enum {
- HTTP_ERR_200 = 0,
- HTTP_ERR_400,
- HTTP_ERR_401,
- HTTP_ERR_403,
- HTTP_ERR_404,
- HTTP_ERR_405,
- HTTP_ERR_407,
- HTTP_ERR_408,
- HTTP_ERR_410,
- HTTP_ERR_421,
- HTTP_ERR_425,
- HTTP_ERR_429,
- HTTP_ERR_500,
- HTTP_ERR_502,
- HTTP_ERR_503,
- HTTP_ERR_504,
- HTTP_ERR_SIZE
-};
-
-/* Note: the strings below make use of chunks. Chunks may carry an allocated
- * size in addition to the length. The size counts from the beginning (str)
- * to the end. If the size is unknown, it MUST be zero, in which case the
- * sample will automatically be duplicated when a change larger than <len> has
- * to be performed. Thus it is safe to always set size to zero.
- */
-struct http_meth {
- enum http_meth_t meth;
- struct buffer str;
-};
-
-struct http_auth_data {
- enum ht_auth_m method; /* one of HTTP_AUTH_* */
- /* 7 bytes unused here */
- struct buffer method_data; /* points to the creditial part from 'Authorization:' header */
- char *user, *pass; /* extracted username & password */
-};
-
-struct http_method_desc {
- enum http_meth_t meth;
- const struct ist text;
-};
-
-extern const int http_err_codes[HTTP_ERR_SIZE];
-extern const char *http_err_msgs[HTTP_ERR_SIZE];
-extern const struct ist http_known_methods[HTTP_METH_OTHER];
-extern const uint8_t http_char_classes[256];
-
-enum http_meth_t find_http_meth(const char *str, const int len);
-int http_get_status_idx(unsigned int status);
-const char *http_get_reason(unsigned int status);
-struct ist http_get_authority(const struct ist uri, int no_userinfo);
-struct ist http_get_path(const struct ist uri);
-int http_header_match2(const char *hdr, const char *end,
- const char *name, int len);
-char *http_find_hdr_value_end(char *s, const char *e);
-char *http_find_cookie_value_end(char *s, const char *e);
-char *http_extract_cookie_value(char *hdr, const char *hdr_end,
- char *cookie_name, size_t cookie_name_l,
- int list, char **value, size_t *value_l);
-int http_parse_qvalue(const char *qvalue, const char **end);
-const char *http_find_url_param_pos(const char **chunks,
- const char* url_param_name,
- size_t url_param_name_l, char delim);
-int http_find_next_url_param(const char **chunks,
- const char* url_param_name, size_t url_param_name_l,
- const char **vstart, const char **vend, char delim);
-
-int http_parse_header(const struct ist hdr, struct ist *name, struct ist *value);
-int http_parse_stline(const struct ist line, struct ist *p1, struct ist *p2, struct ist *p3);
-int http_parse_status_val(const struct ist value, struct ist *status, struct ist *reason);
-
-/*
- * Given a path string and its length, find the position of beginning of the
- * query string. Returns NULL if no query string is found in the path.
- *
- * Example: if path = "/foo/bar/fubar?yo=mama;ye=daddy", and n = 22:
- *
- * find_query_string(path, n, '?') points to "yo=mama;ye=daddy" string.
- */
-static inline char *http_find_param_list(char *path, size_t path_l, char delim)
-{
- char *p;
-
- p = memchr(path, delim, path_l);
- return p ? p + 1 : NULL;
-}
-
-static inline int http_is_param_delimiter(char c, char delim)
-{
- return c == '&' || c == ';' || c == delim;
-}
-
-/* Match language range with language tag. RFC2616 14.4:
- *
- * A language-range matches a language-tag if it exactly equals
- * the tag, or if it exactly equals a prefix of the tag such
- * that the first tag character following the prefix is "-".
- *
- * Return 1 if the strings match, else return 0.
- */
-static inline int http_language_range_match(const char *range, int range_len,
- const char *tag, int tag_len)
-{
- const char *end = range + range_len;
- const char *tend = tag + tag_len;
-
- while (range < end) {
- if (*range == '-' && tag == tend)
- return 1;
- if (*range != *tag || tag == tend)
- return 0;
- range++;
- tag++;
- }
- /* Return true only if the last char of the tag is matched. */
- return tag == tend;
-}
-
-
-#endif /* _COMMON_HTTP_H */
-
-/*
- * Local variables:
- * c-indent-level: 8
- * c-basic-offset: 8
- * End:
- */
diff --git a/include/common/htx.h b/include/common/htx.h
index 664aaca..3c3ac0b 100644
--- a/include/common/htx.h
+++ b/include/common/htx.h
@@ -27,7 +27,7 @@
#include <haproxy/buf.h>
#include <import/ist.h>
#include <haproxy/chunk.h>
-#include <common/http.h>
+#include <haproxy/http-t.h>
#include <common/http-hdr.h>
/*
diff --git a/include/haproxy/http-t.h b/include/haproxy/http-t.h
new file mode 100644
index 0000000..c8bf9a3
--- /dev/null
+++ b/include/haproxy/http-t.h
@@ -0,0 +1,133 @@
+/*
+ * include/haproxy/http-t.h
+ *
+ * Version-agnostic and implementation-agnostic HTTP protocol definitions.
+ *
+ * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _HAPROXY_HTTP_T_H
+#define _HAPROXY_HTTP_T_H
+
+#include <inttypes.h>
+#include <import/ist.h>
+#include <haproxy/buf-t.h>
+
+/*
+ * some macros mainly used when parsing header fields.
+ * from RFC7230:
+ * CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
+ * SEP = one of the 17 defined separators or SP or HT
+ * LWS = CR, LF, SP or HT
+ * SPHT = SP or HT. Use this macro and not a boolean expression for best speed.
+ * CRLF = CR or LF. Use this macro and not a boolean expression for best speed.
+ * token = any CHAR except CTL or SEP. Use this macro and not a boolean expression for best speed.
+ *
+ * added for ease of use:
+ * ver_token = 'H', 'P', 'T', '/', '.', and digits.
+ */
+#define HTTP_FLG_CTL 0x01
+#define HTTP_FLG_SEP 0x02
+#define HTTP_FLG_LWS 0x04
+#define HTTP_FLG_SPHT 0x08
+#define HTTP_FLG_CRLF 0x10
+#define HTTP_FLG_TOK 0x20
+#define HTTP_FLG_VER 0x40
+#define HTTP_FLG_DIG 0x80
+
+#define HTTP_IS_CTL(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_CTL)
+#define HTTP_IS_SEP(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_SEP)
+#define HTTP_IS_LWS(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_LWS)
+#define HTTP_IS_SPHT(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_SPHT)
+#define HTTP_IS_CRLF(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_CRLF)
+#define HTTP_IS_TOKEN(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_TOK)
+#define HTTP_IS_VER_TOKEN(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_VER)
+#define HTTP_IS_DIGIT(x) (http_char_classes[(uint8_t)(x)] & HTTP_FLG_DIG)
+
+/* Known HTTP methods */
+enum http_meth_t {
+ HTTP_METH_OPTIONS,
+ HTTP_METH_GET,
+ HTTP_METH_HEAD,
+ HTTP_METH_POST,
+ HTTP_METH_PUT,
+ HTTP_METH_DELETE,
+ HTTP_METH_TRACE,
+ HTTP_METH_CONNECT,
+ HTTP_METH_OTHER, /* Must be the last entry */
+} __attribute__((packed));
+
+/* Known HTTP authentication schemes */
+enum ht_auth_m {
+ HTTP_AUTH_WRONG = -1, /* missing or unknown */
+ HTTP_AUTH_UNKNOWN = 0,
+ HTTP_AUTH_BASIC,
+ HTTP_AUTH_DIGEST,
+} __attribute__((packed));
+
+/* All implemented HTTP status codes */
+enum {
+ HTTP_ERR_200 = 0,
+ HTTP_ERR_400,
+ HTTP_ERR_401,
+ HTTP_ERR_403,
+ HTTP_ERR_404,
+ HTTP_ERR_405,
+ HTTP_ERR_407,
+ HTTP_ERR_408,
+ HTTP_ERR_410,
+ HTTP_ERR_421,
+ HTTP_ERR_425,
+ HTTP_ERR_429,
+ HTTP_ERR_500,
+ HTTP_ERR_502,
+ HTTP_ERR_503,
+ HTTP_ERR_504,
+ HTTP_ERR_SIZE
+};
+
+/* Note: the strings below make use of chunks. Chunks may carry an allocated
+ * size in addition to the length. The size counts from the beginning (str)
+ * to the end. If the size is unknown, it MUST be zero, in which case the
+ * sample will automatically be duplicated when a change larger than <len> has
+ * to be performed. Thus it is safe to always set size to zero.
+ */
+struct http_meth {
+ enum http_meth_t meth;
+ struct buffer str;
+};
+
+struct http_auth_data {
+ enum ht_auth_m method; /* one of HTTP_AUTH_* */
+ /* 7 bytes unused here */
+ struct buffer method_data; /* points to the creditial part from 'Authorization:' header */
+ char *user, *pass; /* extracted username & password */
+};
+
+struct http_method_desc {
+ enum http_meth_t meth;
+ const struct ist text;
+};
+
+#endif /* _HAPROXY_HTTP_T_H */
+
+/*
+ * Local variables:
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/include/haproxy/http.h b/include/haproxy/http.h
new file mode 100644
index 0000000..64ac4bc
--- /dev/null
+++ b/include/haproxy/http.h
@@ -0,0 +1,115 @@
+/*
+ * include/haproxy/http.h
+ *
+ * Functions for version-agnostic and implementation-agnostic HTTP protocol.
+ *
+ * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _HAPROXY_HTTP_H
+#define _HAPROXY_HTTP_H
+
+#include <stddef.h>
+#include <string.h>
+#include <import/ist.h>
+#include <haproxy/http-t.h>
+
+extern const int http_err_codes[HTTP_ERR_SIZE];
+extern const char *http_err_msgs[HTTP_ERR_SIZE];
+extern const struct ist http_known_methods[HTTP_METH_OTHER];
+extern const uint8_t http_char_classes[256];
+
+enum http_meth_t find_http_meth(const char *str, const int len);
+int http_get_status_idx(unsigned int status);
+const char *http_get_reason(unsigned int status);
+struct ist http_get_authority(const struct ist uri, int no_userinfo);
+struct ist http_get_path(const struct ist uri);
+int http_header_match2(const char *hdr, const char *end,
+ const char *name, int len);
+char *http_find_hdr_value_end(char *s, const char *e);
+char *http_find_cookie_value_end(char *s, const char *e);
+char *http_extract_cookie_value(char *hdr, const char *hdr_end,
+ char *cookie_name, size_t cookie_name_l,
+ int list, char **value, size_t *value_l);
+int http_parse_qvalue(const char *qvalue, const char **end);
+const char *http_find_url_param_pos(const char **chunks,
+ const char* url_param_name,
+ size_t url_param_name_l, char delim);
+int http_find_next_url_param(const char **chunks,
+ const char* url_param_name, size_t url_param_name_l,
+ const char **vstart, const char **vend, char delim);
+
+int http_parse_header(const struct ist hdr, struct ist *name, struct ist *value);
+int http_parse_stline(const struct ist line, struct ist *p1, struct ist *p2, struct ist *p3);
+int http_parse_status_val(const struct ist value, struct ist *status, struct ist *reason);
+
+/*
+ * Given a path string and its length, find the position of beginning of the
+ * query string. Returns NULL if no query string is found in the path.
+ *
+ * Example: if path = "/foo/bar/fubar?yo=mama;ye=daddy", and n = 22:
+ *
+ * find_query_string(path, n, '?') points to "yo=mama;ye=daddy" string.
+ */
+static inline char *http_find_param_list(char *path, size_t path_l, char delim)
+{
+ char *p;
+
+ p = memchr(path, delim, path_l);
+ return p ? p + 1 : NULL;
+}
+
+static inline int http_is_param_delimiter(char c, char delim)
+{
+ return c == '&' || c == ';' || c == delim;
+}
+
+/* Match language range with language tag. RFC2616 14.4:
+ *
+ * A language-range matches a language-tag if it exactly equals
+ * the tag, or if it exactly equals a prefix of the tag such
+ * that the first tag character following the prefix is "-".
+ *
+ * Return 1 if the strings match, else return 0.
+ */
+static inline int http_language_range_match(const char *range, int range_len,
+ const char *tag, int tag_len)
+{
+ const char *end = range + range_len;
+ const char *tend = tag + tag_len;
+
+ while (range < end) {
+ if (*range == '-' && tag == tend)
+ return 1;
+ if (*range != *tag || tag == tend)
+ return 0;
+ range++;
+ tag++;
+ }
+ /* Return true only if the last char of the tag is matched. */
+ return tag == tend;
+}
+
+
+#endif /* _HAPROXY_HTTP_H */
+
+/*
+ * Local variables:
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/include/types/http_ana.h b/include/types/http_ana.h
index 7bade13..4a1a9cd 100644
--- a/include/types/http_ana.h
+++ b/include/types/http_ana.h
@@ -23,7 +23,7 @@
#define _TYPES_PROTO_HTTP_H
#include <haproxy/api-t.h>
-#include <common/http.h>
+#include <haproxy/http-t.h>
#include <types/channel.h>
#include <types/http_htx.h>
diff --git a/include/types/http_htx.h b/include/types/http_htx.h
index 4123e7e..2f6b10b 100644
--- a/include/types/http_htx.h
+++ b/include/types/http_htx.h
@@ -26,7 +26,7 @@
#include <import/ebistree.h>
#include <haproxy/buf-t.h>
-#include <common/http.h>
+#include <haproxy/http-t.h>
#include <common/htx.h>
#include <import/ist.h>
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 2e6a26c..2019de8 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -29,7 +29,7 @@
#include <haproxy/api-t.h>
#include <haproxy/chunk.h>
-#include <common/http.h>
+#include <haproxy/http-t.h>
#include <haproxy/list-t.h>
#include <haproxy/thread.h>
diff --git a/include/types/sample.h b/include/types/sample.h
index 618be08..0bec0c4 100644
--- a/include/types/sample.h
+++ b/include/types/sample.h
@@ -27,7 +27,7 @@
#include <netinet/in.h>
#include <haproxy/buf-t.h>
-#include <common/http.h>
+#include <haproxy/http-t.h>
#include <haproxy/list-t.h>
struct arg;
diff --git a/src/backend.c b/src/backend.c
index a002bbe..6d85967 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -21,6 +21,7 @@
#include <haproxy/api.h>
#include <haproxy/hash.h>
+#include <haproxy/http.h>
#include <common/htx.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
diff --git a/src/checks.c b/src/checks.c
index 2374f65..b0d6776 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -39,7 +39,7 @@
#include <common/standard.h>
#include <haproxy/time.h>
#include <haproxy/thread.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <common/h1.h>
#include <common/htx.h>
diff --git a/src/da.c b/src/da.c
index c783fb1..51f6e38 100644
--- a/src/da.c
+++ b/src/da.c
@@ -3,7 +3,7 @@
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <haproxy/errors.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <types/global.h>
#include <proto/arg.h>
#include <proto/http_fetch.h>
diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index 4b0e546..5f0853a 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -12,6 +12,7 @@
#include <haproxy/api.h>
#include <haproxy/dynbuf.h>
+#include <haproxy/http.h>
#include <common/cfgparse.h>
#include <common/htx.h>
#include <haproxy/list.h>
diff --git a/src/h1_htx.c b/src/h1_htx.c
index 6e582e3..83ebfb1 100644
--- a/src/h1_htx.c
+++ b/src/h1_htx.c
@@ -13,7 +13,7 @@
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/h1.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <common/htx.h>
#include <proto/h1_htx.h>
diff --git a/src/h2.c b/src/h2.c
index c94ea8e..fa72e1c 100644
--- a/src/h2.c
+++ b/src/h2.c
@@ -27,6 +27,7 @@
#include <inttypes.h>
#include <haproxy/api.h>
+#include <haproxy/http.h>
#include <common/h2.h>
#include <common/http-hdr.h>
#include <import/ist.h>
diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
index 53a2b40..b759f11 100644
--- a/src/hlua_fcn.c
+++ b/src/hlua_fcn.c
@@ -18,6 +18,7 @@
#include <lua.h>
#include <lualib.h>
+#include <haproxy/http.h>
#include <haproxy/net_helper.h>
#include <haproxy/regex.h>
#include <haproxy/time.h>
diff --git a/src/http.c b/src/http.c
index 0bd8f87..ae315a8 100644
--- a/src/http.c
+++ b/src/http.c
@@ -12,7 +12,7 @@
#include <ctype.h>
#include <haproxy/api.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <common/standard.h>
/* It is about twice as fast on recent architectures to lookup a byte in a
diff --git a/src/http_acl.c b/src/http_acl.c
index 368a4b1..780962a 100644
--- a/src/http_acl.c
+++ b/src/http_acl.c
@@ -18,7 +18,7 @@
#include <haproxy/api.h>
#include <haproxy/chunk.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <haproxy/pool.h>
#include <common/standard.h>
#include <haproxy/version.h>
diff --git a/src/http_act.c b/src/http_act.c
index 4193b91..a5ce9d7 100644
--- a/src/http_act.c
+++ b/src/http_act.c
@@ -19,7 +19,7 @@
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <haproxy/chunk.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <haproxy/pool.h>
#include <haproxy/regex.h>
#include <common/standard.h>
diff --git a/src/http_ana.c b/src/http_ana.c
index 9f65082..d89bcf5 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -12,6 +12,7 @@
#include <haproxy/api.h>
#include <haproxy/base64.h>
+#include <haproxy/http.h>
#include <common/htx.h>
#include <haproxy/net_helper.h>
#include <haproxy/regex.h>
diff --git a/src/http_conv.c b/src/http_conv.c
index 8937fa0..72cb4af 100644
--- a/src/http_conv.c
+++ b/src/http_conv.c
@@ -18,7 +18,7 @@
#include <haproxy/api.h>
#include <haproxy/chunk.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <haproxy/pool.h>
#include <common/standard.h>
#include <haproxy/version.h>
diff --git a/src/http_fetch.c b/src/http_fetch.c
index 8fe22b8..2d99642 100644
--- a/src/http_fetch.c
+++ b/src/http_fetch.c
@@ -20,7 +20,7 @@
#include <haproxy/base64.h>
#include <haproxy/chunk.h>
#include <common/h1.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <common/htx.h>
#include <haproxy/pool.h>
#include <common/standard.h>
diff --git a/src/http_htx.c b/src/http_htx.c
index af8758c..ede8a0e 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -20,7 +20,7 @@
#include <common/cfgparse.h>
#include <common/h1.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <common/htx.h>
#include <proto/arg.h>
diff --git a/src/http_rules.c b/src/http_rules.c
index 96508e9..94aff63 100644
--- a/src/http_rules.c
+++ b/src/http_rules.c
@@ -19,7 +19,7 @@
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <haproxy/chunk.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <haproxy/pool.h>
#include <common/standard.h>
#include <haproxy/version.h>
diff --git a/src/log.c b/src/log.c
index d4f4922..5778994 100644
--- a/src/log.c
+++ b/src/log.c
@@ -25,6 +25,7 @@
#include <sys/uio.h>
#include <haproxy/api.h>
+#include <haproxy/http.h>
#include <common/standard.h>
#include <haproxy/time.h>
#include <haproxy/version.h>
diff --git a/src/sample.c b/src/sample.c
index 14615a1..380dd6f 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -21,7 +21,7 @@
#include <haproxy/chunk.h>
#include <haproxy/hash.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <haproxy/net_helper.h>
#include <haproxy/regex.h>
#include <common/standard.h>
diff --git a/src/session.c b/src/session.c
index d31806a..619ff06 100644
--- a/src/session.c
+++ b/src/session.c
@@ -11,7 +11,7 @@
*/
#include <haproxy/api.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <haproxy/pool.h>
#include <types/global.h>
diff --git a/src/stats.c b/src/stats.c
index b5f5e9c..4820d3b 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -27,7 +27,7 @@
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <haproxy/debug.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <common/htx.h>
#include <haproxy/pool.h>
#include <haproxy/list.h>
diff --git a/src/vars.c b/src/vars.c
index 227c94b..edcf1af 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -2,7 +2,7 @@
#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/http.h>
+#include <haproxy/http.h>
#include <haproxy/list.h>
#include <types/vars.h>