r7070: fix redirection when the client
[sfrench/samba-autobuild/.git] / 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") {
-       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");
 }