chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Start reimplenting search in Disobedience choose tabs. Results are
[disorder]
/
lib
/
url.c
diff --git
a/lib/url.c
b/lib/url.c
index 6d1991167f682963c14d79f85cb00c4b65cc5560..b7772829e64a293a30ec21ba8fc25ce9004527f2 100644
(file)
--- a/
lib/url.c
+++ b/
lib/url.c
@@
-21,13
+21,9
@@
* @brief URL support functions
*/
* @brief URL support functions
*/
-#include <config.h>
-#include "types.h"
+#include "common.h"
-#include <stdio.h>
-#include <stdlib.h>
#include <errno.h>
#include <errno.h>
-#include <string.h>
#include "mem.h"
#include "log.h"
#include "mem.h"
#include "log.h"
@@
-44,6
+40,10
@@
char *infer_url(void) {
const char *scheme = "http", *server, *script, *e, *request_uri;
char *url;
int port;
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. */
/* Figure out the server. 'MUST' be set and we don't cope if it
* is not. */