X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=d3adf6d42de244fe5af23c2c46e0b6c8071b8fb5;hb=2d0ada79f156cfca001f06278156ee4fea848837;hp=8ebdb0b5ebe08b101d30a0d92b1597998a14cde1;hpb=2c2d989ff30a4218303d803b9bfdb1e1fbf0967d;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 8ebdb0b..d3adf6d 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -906,7 +906,8 @@ function mkws_html_all() { if (mkws_config.use_service_proxy) mkws_service_proxy_auth(mkws_config.service_proxy_auth, - mkws_config.service_proxy_auth_domain); + mkws_config.service_proxy_auth_domain, + mkws_config.pazpar2_url); if (mkws_config.responsive_design_width) { // Responsive web design - change layout on the fly based on @@ -1015,9 +1016,14 @@ function mkws_html_perpage() { * The username/password is configured in the apache config file * for the site. */ -function mkws_service_proxy_auth(auth_url, auth_domain) { +function mkws_service_proxy_auth(auth_url, auth_domain, pp2_url) { debug("Run service proxy auth URL: " + auth_url); + if (!auth_domain) { + auth_domain = pp2_url.replace(/^http:\/\/(.*?)\/.*/, '$1'); + debug("guessed auth_domain '" + auth_domain + "' from pp2_url '" + pp2_url + "'"); + } + var request = new pzHttpRequest(auth_url, function(err) { alert("HTTP call for authentication failed: " + err) return;