From 8211285a4c1370dc0eae8bd376280e53e6308739 Mon Sep 17 00:00:00 2001 From: javi Date: Tue, 25 Feb 2014 16:04:20 +0100 Subject: [PATCH] fixed windshaft provider with https --- lib/torque/provider.windshaft.js | 5 ++++- test/provider.windshaft.test.js | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/torque/provider.windshaft.js b/lib/torque/provider.windshaft.js index 89382f5..fafc5f6 100644 --- a/lib/torque/provider.windshaft.js +++ b/lib/torque/provider.windshaft.js @@ -331,7 +331,10 @@ if (!this.options.cdn_url) { return this._tilerHost(); } - var h = protocol + "://{s}."; + var h = protocol + "://" + if (protocol === 'http') { + h += "{s}."; + } var cdn_host = opts.cdn_url; if(!cdn_host.http && !cdn_host.https) { throw new Error("cdn_host should contain http and/or https entries"); diff --git a/test/provider.windshaft.test.js b/test/provider.windshaft.test.js index 6116538..bc8fc84 100644 --- a/test/provider.windshaft.test.js +++ b/test/provider.windshaft.test.js @@ -38,7 +38,7 @@ module('provider.windshaft', { "layers": [{ "type": "torque", "options": { - "cartocss_version": "2.1.1", + "cartocss_version": "1.0.0", "cartocss": '#test{}', "sql": 'test' } @@ -60,6 +60,12 @@ module('provider.windshaft', { equal(windshaft.url(), "http://{s}.cartocdn.com/rambo"); }); + test("url cdn https", function() { + windshaft.options.tiler_protocol = 'https'; + windshaft.options.cdn_url = { https: 'cartocdn.com' }; + equal(windshaft.url(), "https://cartocdn.com/rambo"); + }); + test("named map", function() { windshaft_named = new torque.providers.windshaft({ table: 'test',