chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d0b6635
)
infer_url() now attempts to spot https
author
Richard Kettlewell
<rjk@greenend.org.uk>
Sat, 10 May 2008 19:48:15 +0000
(20:48 +0100)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Sat, 10 May 2008 19:48:15 +0000
(20:48 +0100)
lib/url.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/url.c
b/lib/url.c
index 6d1991167f682963c14d79f85cb00c4b65cc5560..16f3257d25883ae577feffaab1fb06c58ee6e2d5 100644
(file)
--- 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. */