Skip to content

Commit

Permalink
v1.10.4 from apache svn 2.4.x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Eissing committed May 2, 2017
1 parent 243a40a commit 062a466
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.10.4
--------------------------------------------------------------------------------
* mod_proxy_http2: adding support for Reverse Proxy Request headers.

v1.10.3
--------------------------------------------------------------------------------
* fixed possible deadlock that could occur when connections were
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#

AC_PREREQ([2.69])
AC_INIT([mod_http2], [1.10.3], [[email protected]])
AC_INIT([mod_http2], [1.10.4], [[email protected]])

LT_PREREQ([2.2.6])
LT_INIT()
Expand Down
26 changes: 26 additions & 0 deletions mod_http2/h2_proxy_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,32 @@ static apr_status_t open_stream(h2_proxy_session *session, const char *url,
h2_proxy_req_make(stream->req, stream->pool, r->method, scheme,
authority, path, r->headers_in);

if (dconf->add_forwarded_headers) {
if (PROXYREQ_REVERSE == r->proxyreq) {
const char *buf;

/* Add X-Forwarded-For: so that the upstream has a chance to
* determine, where the original request came from.
*/
apr_table_mergen(stream->req->headers, "X-Forwarded-For",
r->useragent_ip);

/* Add X-Forwarded-Host: so that upstream knows what the
* original request hostname was.
*/
if ((buf = apr_table_get(r->headers_in, "Host"))) {
apr_table_mergen(stream->req->headers, "X-Forwarded-Host", buf);
}

/* Add X-Forwarded-Server: so that upstream knows what the
* name of this proxy server is (if there are more than one)
* XXX: This duplicates Via: - do we strictly need it?
*/
apr_table_mergen(stream->req->headers, "X-Forwarded-Server",
r->server->server_hostname);
}
}

/* Tuck away all already existing cookies */
stream->saves = apr_table_make(r->pool, 2);
apr_table_do(add_header, stream->saves, r->headers_out, "Set-Cookie", NULL);
Expand Down
4 changes: 2 additions & 2 deletions mod_http2/h2_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
* @macro
* Version number of the http2 module as c string
*/
#define MOD_HTTP2_VERSION "1.10.3-git"
#define MOD_HTTP2_VERSION "1.10.4-git"

/**
* @macro
* Numerical representation of the version number of the http2 module
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define MOD_HTTP2_VERSION_NUM 0x010a03
#define MOD_HTTP2_VERSION_NUM 0x010a04


#endif /* mod_h2_h2_version_h */

0 comments on commit 062a466

Please sign in to comment.