* @brief URL support functions
*/
-#include <config.h>
-#include "types.h"
+#include "common.h"
-#include <stdio.h>
-#include <stdlib.h>
#include <errno.h>
-#include <string.h>
#include "mem.h"
#include "log.h"
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. */