From 3c35e8a0720481f5c235fe32d7f128642661bc41 Mon Sep 17 00:00:00 2001 Message-Id: <3c35e8a0720481f5c235fe32d7f128642661bc41.1715294075.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 10 May 2008 20:48:15 +0100 Subject: [PATCH] infer_url() now attempts to spot https Organization: Straylight/Edgeware From: Richard Kettlewell --- lib/url.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/url.c b/lib/url.c index 6d19911..16f3257 100644 --- a/lib/url.c +++ b/lib/url.c @@ -44,6 +44,10 @@ char *infer_url(void) { const char *scheme = "http", *server, *script, *e, *request_uri; char *url; int port; + + /* mod_ssl sets HTTPS=on if the scheme is https */ + if((e = getenv("HTTPS")) && !strcmp(e, "on")) + scheme = "https"; /* Figure out the server. 'MUST' be set and we don't cope if it * is not. */ -- [mdw]