--- webapp-module-1.0.1-tc401/apache-1.3/mod_webapp.c	Thu Nov  1 17:20:51 2001
+++ webapp-module-1.0.1-tc401.fixsecure/apache-1.3/mod_webapp.c	Wed Jan  2 20:02:08 2002
@@ -424,6 +424,9 @@
     char *ctmp=NULL;
     char *ssl_temp;
     int ret=0;
+    /* Add extra variables ... not sure if we need cgi but putting in */
+    ap_add_cgi_vars(r);
+    ap_add_common_vars(r);
 
     /* Paranoid check */
     if (!wam_initialized) return(DECLINED);
@@ -457,7 +460,6 @@
     req->ruri=apr_pstrdup(req->pool,r->uri);
     req->args=apr_pstrdup(req->pool,r->args);
     req->prot=apr_pstrdup(req->pool,r->protocol);
-    req->schm=apr_pstrdup(req->pool,ap_http_method(r));
     req->user=apr_pstrdup(req->pool,con->user);
     req->auth=apr_pstrdup(req->pool,con->ap_auth_type);
     req->clen=0;
@@ -467,6 +469,9 @@
     /* SSL logic */
     ssl_temp = (char *)ap_table_get(r->subprocess_env,"HTTPS");
     if ( ssl_temp && !strcasecmp(ssl_temp, "on")) {
+        /* Set the scheme of the request to https as we're on */
+        req->schm=apr_pstrdup(req->pool,"https");
+        
         req->ssld=(wa_ssldata *) apr_palloc(req->pool,sizeof(wa_ssldata));
 
         req->ssld->ciph = (char *)ap_table_get(
@@ -484,6 +489,8 @@
         req->ssld->cert = (char *)ap_table_get(
             r->subprocess_env,"SSL_CLIENT_CERT");
     } else {
+        /* not an https request so just set scheme to http */
+        req->schm=apr_pstrdup(req->pool,"http");
         req->ssld=NULL;
     }
 

