httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1674632 - in /httpd/httpd/trunk: CHANGES docs/log-message-tags/next-number modules/proxy/mod_proxy_wstunnel.c
Date Sun, 19 Apr 2015 15:51:03 GMT
Author: ylavic
Date: Sun Apr 19 15:51:03 2015
New Revision: 1674632

URL: http://svn.apache.org/r1674632
Log:
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.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/log-message-tags/next-number
    httpd/httpd/trunk/modules/proxy/mod_proxy_wstunnel.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1674632&r1=1674631&r2=1674632&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Apr 19 15:51:03 2015
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) 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_proxy_scgi: ProxySCGIInternalRedirect now allows an alternate
      response header to be used by the application, for when the application
      or framework is unable to return Location in the internal-redirect

Modified: httpd/httpd/trunk/docs/log-message-tags/next-number
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/log-message-tags/next-number?rev=1674632&r1=1674631&r2=1674632&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/log-message-tags/next-number (original)
+++ httpd/httpd/trunk/docs/log-message-tags/next-number Sun Apr 19 15:51:03 2015
@@ -1 +1 @@
-2900
+2901

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_wstunnel.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_wstunnel.c?rev=1674632&r1=1674631&r2=1674632&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_wstunnel.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_wstunnel.c Sun Apr 19 15:51:03 2015
@@ -466,6 +466,7 @@ static int proxy_wstunnel_handler(reques
     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(reques
         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);
 



Mime
View raw message