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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user