1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1674632 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2015-04-19 15:51:03 +00:00
parent 4e38a6ac30
commit 76f7cbf485
3 changed files with 13 additions and 1 deletions

View File

@@ -466,6 +466,7 @@ static int proxy_wstunnel_handler(request_rec *r, proxy_worker *worker,
int status;
char server_portstr[32];
proxy_conn_rec *backend = NULL;
const char *upgrade;
char *scheme;
int retry;
conn_rec *c = r->connection;
@@ -485,6 +486,13 @@ static int proxy_wstunnel_handler(request_rec *r, proxy_worker *worker,
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);