diff -u -w -b -r1.3 -r1.3.2.1
--- mod_proxy.c	14 Apr 2003 09:49:53 -0000	1.3
+++ mod_proxy.c	21 Oct 2003 13:55:57 -0000	1.3.2.1
@@ -164,6 +164,43 @@
         r->filename = apr_pstrcat(r->pool, "proxy:", r->uri, NULL);
         r->handler = "proxy-server";
     }
+	/* Try to be a catch-all for non-proxy requests that are not meant for us.
+	 * We might be getting these because someone wants to use us as a 
+	 * transparent proxy. 
+	 * Construct the full URL by fishing the target web server from the Host 
+	 * request header. */
+	else if (conf->req && !r->parsed_uri.scheme) {
+		const char *target = apr_table_get(r->headers_in, "Host");
+		char *target_host = NULL;
+		int colon = -1;
+		ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "CATCHALL: target = %s", target ? target : "none");
+		
+		if (target) {
+			colon = ap_ind(target, ':');
+			if (colon < 0) {
+				target_host = (char *)target;
+			} else {
+				target_host = apr_pstrndup(r->pool, target, colon);
+			}
+			if (!ap_matches_request_vhost(r, target_host,
+											  (apr_port_t)(r->parsed_uri.port_str ? r->parsed_uri.port 
+											  : ap_default_port(r)))) {
+				r->proxyreq = PROXYREQ_PROXY;
+				r->uri = apr_pstrcat(r->pool, ap_http_method(r), "://", NULL);
+				if (r->parsed_uri.user) {
+					r->uri = apr_pstrcat(r->pool, r->uri, r->parsed_uri.user, NULL);
+					if (r->parsed_uri.password) {
+						r->uri = apr_pstrcat(r->pool, r->uri, ":", r->parsed_uri.password, NULL);
+					}
+					r->uri = apr_pstrcat(r->pool, r->uri, "@", NULL);
+				}
+				r->uri = apr_pstrcat(r->pool, r->uri, target, r->unparsed_uri, NULL);
+				ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "CATCHALL: Constructed url = %s", r->uri);
+				r->filename = apr_pstrcat(r->pool, "proxy:", r->uri, NULL);
+				r->handler = "proxy-server";
+			}
+		}
+	}
     return DECLINED;
 }
 
