summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenjamin.dauvergne <benjamin.dauvergne@a716ebb1-153a-0410-b759-cfb97c6a1b53>2010-10-21 13:07:50 +0000
committerbenjamin.dauvergne <benjamin.dauvergne@a716ebb1-153a-0410-b759-cfb97c6a1b53>2010-10-21 13:07:50 +0000
commit227d1f80c86e9b1a9da097ea50e2699ddc8be3f2 (patch)
treedc459ece01ff1e8bb67e39c7864c1959fb0c2a07
parent6bb1e530d1437eaaa0cf44bd1c3cd34b10289d42 (diff)
downloadmod_auth_mellon-227d1f80c86e9b1a9da097ea50e2699ddc8be3f2.tar.gz
mod_auth_mellon-227d1f80c86e9b1a9da097ea50e2699ddc8be3f2.tar.xz
mod_auth_mellon-227d1f80c86e9b1a9da097ea50e2699ddc8be3f2.zip
Change implementation of am_get_endpoint_url to use ap_construct_url
ap_construct_url() use the ServerName directive to reconstruct an absolute URL. It allows to force the use of an https:// URL (when you are behind an SSL proxy it is needed) by configuring your VirtualHost like that: ServerName https://example.com git-svn-id: https://modmellon.googlecode.com/svn/trunk@110 a716ebb1-153a-0410-b759-cfb97c6a1b53
-rw-r--r--auth_mellon_util.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/auth_mellon_util.c b/auth_mellon_util.c
index bafab58..a0949bd 100644
--- a/auth_mellon_util.c
+++ b/auth_mellon_util.c
@@ -802,32 +802,9 @@ char *am_htmlencode(request_rec *r, const char *str)
*/
char *am_get_endpoint_url(request_rec *r)
{
- static APR_OPTIONAL_FN_TYPE(ssl_is_https) *am_is_https = NULL;
am_dir_cfg_rec *cfg = am_get_dir_cfg(r);
- apr_pool_t *p = r->pool;
- server_rec *s = r->server;
- apr_port_t default_port;
- char *port;
- char *scheme;
- am_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https);
-
- if (am_is_https && am_is_https(r->connection)) {
- scheme = "https://";
- default_port = DEFAULT_HTTPS_PORT;
- } else {
- scheme = "http://";
- default_port = DEFAULT_HTTP_PORT;
- }
-
- if (s->addrs->host_port != default_port)
- port = apr_psprintf(p, ":%d", s->addrs->host_port);
- else
- port = "";
-
- return apr_psprintf(p, "%s%s%s%s", scheme,
- s->server_hostname,
- port, cfg->endpoint_path);
+ return ap_construct_url(r->pool, cfg->endpoint_path, r);
}
/*