r7070: fix redirection when the client
authorStefan Metzmacher <metze@samba.org>
Sun, 29 May 2005 11:16:45 +0000 (11:16 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:12 +0000 (13:17 -0500)
doesn't send a 'Host' header

metze
(This used to be commit ccc4d51927eb1564c6f5de07dda83dd008bb8a9e)

swat/index.esp

index 037e88836c7c1d1f26cb918dab6758de1842f4dd..373bd9f74e7d88af1c68474cb7c6230d1598b0a3 100644 (file)
@@ -7,7 +7,11 @@ redirecting you to the test pages ...
 <%
 if (server['SERVER_PROTOCOL'] == "http" &&
     server['TLS_SUPPORT'] == "True") {
 <%
 if (server['SERVER_PROTOCOL'] == "http" &&
     server['TLS_SUPPORT'] == "True") {
-       redirect("https://" + headers['HOST'] + request['REQUEST_URI']);
+       if (headers['HOST']) {
+               redirect("https://" + headers['HOST'] + request['REQUEST_URI']);
+       } else {
+               redirect("https://" + server['SERVER_NAME'] + ":" + server['SERVER_PORT'] + request['REQUEST_URI']);
+       }
 } else {
        redirect("esptest/index.esp");
 }
 } else {
        redirect("esptest/index.esp");
 }