httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1053872 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_rewrite.html.en docs/manual/mod/mod_rewrite.xml modules/mappers/mod_rewrite.c server/util_script.c
Date Thu, 30 Dec 2010 12:34:20 GMT
Author: sf
Date: Thu Dec 30 12:34:19 2010
New Revision: 1053872

URL: http://svn.apache.org/viewvc?rev=1053872&view=rev
Log:
Make the REQUEST_SCHEME variable available to scripts and mod_rewrite

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en
    httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c
    httpd/httpd/trunk/server/util_script.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1053872&r1=1053871&r2=1053872&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Thu Dec 30 12:34:19 2010
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.3.11
 
+  *) core, mod_rewrite: Make the REQUEST_SCHEME variable available to
+     scripts and mod_rewrite. [Stefan Fritsch]
+
   *) mod_rewrite: Allow to use arbitrary boolean expressions (ap_expr) in
      RewriteCond. [Stefan Fritsch]
 

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en?rev=1053872&r1=1053871&r2=1053872&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en Thu Dec 30 12:34:19 2010
@@ -263,6 +263,7 @@ RewriteRule ^index\.html$  newsite.html
                  REQUEST_FILENAME<br />
                  IS_SUBREQ<br />
                  HTTPS<br />
+                 REQUEST_SCHEME<br />
               </td>
             </tr>
           </table>
@@ -325,6 +326,12 @@ RewriteRule ^index\.html$  newsite.html
                   can be safely used regardless of whether or not
                   <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>
is loaded).</dd>
 
+                  <dt><code>REQUEST_SCHEME</code></dt>
+
+                  <dd>Will contain the scheme of the request (ususally
+                  "http" or "https"). This value can be influenced with
+                  <code class="directive"><a href="../mod/core.html#servername">ServerName</a></code>.</dd>
+
                 </dl>
 </div>
         </li>

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml?rev=1053872&r1=1053871&r2=1053872&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Thu Dec 30 12:34:19 2010
@@ -436,6 +436,7 @@ RewriteRule ^index\.html$  newsite.html
                  REQUEST_FILENAME<br />
                  IS_SUBREQ<br />
                  HTTPS<br />
+                 REQUEST_SCHEME<br />
               </td>
             </tr>
           </table>
@@ -498,6 +499,12 @@ RewriteRule ^index\.html$  newsite.html
                   can be safely used regardless of whether or not
                   <module>mod_ssl</module> is loaded).</dd>
 
+                  <dt><code>REQUEST_SCHEME</code></dt>
+
+                  <dd>Will contain the scheme of the request (ususally
+                  "http" or "https"). This value can be influenced with
+                  <directive module="core">ServerName</directive>.</dd>
+
                 </dl>
 </note>
         </li>

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1053872&r1=1053871&r2=1053872&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Thu Dec 30 12:34:19 2010
@@ -2089,9 +2089,12 @@ static char *lookup_variable(char *var, 
             if (*var == 'H' && !strcmp(var, "HTTP_FORWARDED")) {
                 result = lookup_header("Forwarded", ctx);
             }
-            else if (!strcmp(var, "REQUEST_METHOD")) {
+            else if (var[8] == 'M' && !strcmp(var, "REQUEST_METHOD")) {
                 result = r->method;
             }
+            else if (!strcmp(var, "REQUEST_SCHEME")) {
+                result = ap_http_scheme(r);
+            }
             break;
 
         case 15:

Modified: httpd/httpd/trunk/server/util_script.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_script.c?rev=1053872&r1=1053871&r2=1053872&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_script.c (original)
+++ httpd/httpd/trunk/server/util_script.c Thu Dec 30 12:34:19 2010
@@ -337,6 +337,7 @@ AP_DECLARE(void) ap_add_cgi_vars(request
     apr_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
     apr_table_setn(e, "SERVER_PROTOCOL", r->protocol);
     apr_table_setn(e, "REQUEST_METHOD", r->method);
+    apr_table_setn(e, "REQUEST_SCHEME", ap_http_scheme(r));
     apr_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
     apr_table_setn(e, "REQUEST_URI", original_uri(r));
 



Mime
View raw message