From 12f0826d32063c0256c665d8a9bfa20d4f53c01c Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 12 Nov 2013 17:41:10 +0100 Subject: [PATCH] Do not force ending dot in SQL-API hostname, for easier testing --- NEWS.md | 1 + lib/cartodb/server_options.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 22c08979..2539e419 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ * Add support for specifying database connection passwords * Add support for reading user-specific database_host from redis, as per CartoDB-2.5.0 model (#88) +* Do not force ending dot in SQL-API hostname, for easier testing 1.4.1 -- 2013-11-08 ------------------- diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 43b0a533..607bd1aa 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -67,7 +67,9 @@ module.exports = function(){ var api = global.environment.sqlapi; // build up api string - var sqlapi = api.protocol + '://' + username + '.' + api.domain + ':' + api.port + '/api/' + api.version + '/sql' + var sqlapi = api.protocol + '://' + username; + if ( api.domain ) sqlapi += '.' + api.domain; + sqlapi += ':' + api.port + '/api/' + api.version + '/sql' var qs = { q: sql }