mod_proxy_wstunnel: Bypass the handler while the connection is not
upgraded to WebSocket, so that other modules can possibly take over
the leading HTTP requests.
Submitted by: ylavic
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1674661 13f79535-47bb-0310-9956-
ffa450edef68
calls r:wsupgrade() can cause a child process crash.
[Edward Lu <Chaosed0 gmail.com>]
+ *) mod_proxy_wstunnel: Bypass the handler while the connection is not
+ upgraded to WebSocket, so that other modules can possibly take over
+ the leading HTTP requests. [Yann Ylavic]
+
*) mod_http: Fix incorrect If-Match handling. PR 57358
[Kunihiko Sakamoto <ksakamoto google.com>]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) mod_proxy_wstunnel: Bypass the handler while the connection is not
- upgraded to WebSocket, so that other modules can possibly take over
- the leading HTTP requests.
- trunk patch: http://svn.apache.org/r1674632
- 2.4.x patch: trunk works (modulo CHANGES, docs/log-message-tags)
- +1: ylavic, covener, jim
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
int status;
char server_portstr[32];
proxy_conn_rec *backend = NULL;
+ const char *upgrade;
char *scheme;
int retry;
conn_rec *c = r->connection;
return DECLINED;
}
+ upgrade = apr_table_get(r->headers_in, "Upgrade");
+ if (!upgrade || strcasecmp(upgrade, "WebSocket") != 0) {
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02900)
+ "declining URL %s (not WebSocket)", url);
+ return DECLINED;
+ }
+
uri = apr_palloc(p, sizeof(*uri));
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02451) "serving URL %s", url);