commit
c529ac41ff
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@ node_modules*
|
||||
.idea/*
|
||||
.vscode/
|
||||
test/redis.pid
|
||||
test/redis-server.log
|
||||
test/test.log
|
||||
test/acceptance/oauth/venv/*
|
||||
coverage/
|
||||
|
@ -149,8 +149,9 @@ OgrFormat.prototype.toOGR = function (options, outFormat, outFilename, callback)
|
||||
|
||||
var ogrargs = [
|
||||
'-f', outFormat,
|
||||
'-lco', 'RESIZE=YES',
|
||||
'-lco', 'ENCODING=UTF-8',
|
||||
'-lco', 'RESIZE=YES', /* shapefile */
|
||||
'-lco', 'ENCODING=UTF-8', /* shapefile */
|
||||
'-lco', 'STRING_QUOTING=IF_NEEDED', /* csv: Match gdal 2.2 behaviour */
|
||||
'-lco', 'LINEFORMAT=CRLF',
|
||||
outFilename,
|
||||
'PG:host=' + dbhost + ' port=' + dbport + ' user=' + dbuser + ' dbname=' + dbname + ' password=' + dbpass,
|
||||
|
@ -67,7 +67,7 @@ describe('cache headers', function () {
|
||||
assert.response(server, {
|
||||
url: `/api/v1/sql?${qs.encode({
|
||||
api_key: '1234',
|
||||
q: `select CDB_TableMetadataTouch('${tableName}'::regclass)`
|
||||
q: `select cartodb.CDB_TableMetadataTouch('${tableName}'::regclass)`
|
||||
})}`,
|
||||
headers: {
|
||||
host: 'vizzuality.cartodb.com'
|
||||
|
@ -210,4 +210,23 @@ describe('export.csv', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('maintains output compatible with gdal 2.2', function (done) {
|
||||
assert.response(server, {
|
||||
url: '/api/v1/sql?' + querystring.stringify({
|
||||
q: 'SELECT cartodb_id, natscale, adm0cap from populated_places_simple_reduced limit 1',
|
||||
format: 'csv'
|
||||
}),
|
||||
headers: { host: 'vizzuality.cartodb.com' },
|
||||
method: 'GET'
|
||||
},
|
||||
{
|
||||
status: 200
|
||||
},
|
||||
function (err, res) {
|
||||
assert.ifError(err);
|
||||
assert.strictEqual(res.body.split('\r\n')[1], '1109,20,0');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -92,7 +92,7 @@ describe('Surrogate-Key header', function () {
|
||||
});
|
||||
|
||||
it('should not add header for CDB_QueryTables', function (done) {
|
||||
var sql = "SELECT CDB_QueryTablesText('select * from untitle_table_4')";
|
||||
var sql = "SELECT cartodb.CDB_QueryTablesText('select * from untitle_table_4')";
|
||||
assert.response(server, createGetRequest(sql), RESPONSE_OK, function (err, res) {
|
||||
assert.ifError(err);
|
||||
assert.ok(!Object.prototype.hasOwnProperty.call(res, 'surrogate-key'), res.headers['surrogate-key']);
|
||||
|
@ -93,7 +93,7 @@ describe('X-Cache-Channel header', function () {
|
||||
});
|
||||
|
||||
it('should not add header for CDB_QueryTables', function (done) {
|
||||
var sql = "SELECT CDB_QueryTablesText('select * from untitle_table_4')";
|
||||
var sql = "SELECT cartodb.CDB_QueryTablesText('select * from untitle_table_4')";
|
||||
assert.response(server, createGetRequest(sql), RESPONSE_OK, function (err, res) {
|
||||
assert.ifError(err);
|
||||
assert.ok(!Object.prototype.hasOwnProperty.call(res.headers, 'x-cache-channel'), res.headers['x-cache-channel']);
|
||||
|
Loading…
Reference in New Issue
Block a user