X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/0688055d6045c4a9916bd7c2b328cc98139905da..0d0253c93a64d2b5206e902c648e1e2c6bc5d510:/lib/url.c diff --git a/lib/url.c b/lib/url.c index 2579ec1..16f3257 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1,6 +1,6 @@ /* * This file is part of DisOrder - * Copyright (C) 2007 Richard Kettlewell + * Copyright (C) 2007, 2008 Richard Kettlewell * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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. */