Skip to content

Commit

Permalink
Ensure text-face-name errors raise at layergroup creation time
Browse files Browse the repository at this point in the history
Closes #93, includes testcase.
Required change in tilelive-mapnik (our fork)
  • Loading branch information
Sandro Santilli committed Nov 13, 2013
1 parent 9278c16 commit c3ac948
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Version 0.14.3-dev

- Return CORS headers when creating layergroups via GET (#92)
- Fix http status on database authentication error (#94)
- Ensure bogus text-face-name error raises at layergroup creation (#93)

Version 0.14.2
2013-11-08
Expand Down
3 changes: 3 additions & 0 deletions lib/windshaft/render_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ module.exports = function(timeout, mml_store, mapnik_opts) {
query: query,
protocol: 'mapnik:',
slashes: true,
// Trigger font errors at load time, see
// https://github.com/CartoDB/Windshaft/issues/93
strict: true,
xml: data,
mml: {
format: params.format
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"generic-pool": "~2.0.3",
"express": "~2.5.11",
"tilelive": "~4.4.2",
"tilelive-mapnik": "git://github.com/Vizzuality/tilelive-mapnik.git#5908346",
"tilelive-mapnik": "git://github.com/Vizzuality/tilelive-mapnik.git#0.5.0-cdb2",
"mapnik": "~0.7.17",
"lru-cache": "~2.3.0"
},
Expand Down
26 changes: 26 additions & 0 deletions test/acceptance/multilayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,32 @@ suite('multilayer', function() {
});
});

// See https://github.com/CartoDB/Windshaft/issues/94
test("unknown text-face-name", function(done) {

var layergroup = {
version: '1.0.1',
layers: [
{ options: {
sql: "select 1.0 as n, 'SRID=3857;POINT(0 0)'::geometry as the_geom",
cartocss: '#s { text-name: [n]; text-face-name: "bogus"; }',
cartocss_version: '2.1.0',
} }
]
};
assert.response(server, {
url: '/database/windshaft_test/layergroup',
method: 'POST',
headers: {host: 'localhost', 'Content-Type': 'application/json' },
data: JSON.stringify(layergroup)
}, {}, function(res) {
assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body);
var parsedBody = JSON.parse(res.body);
assert.deepEqual(parsedBody, {"errors":["style0: Failed to find font face 'bogus'"]});
done();
});
});

////////////////////////////////////////////////////////////////////
//
// OPTIONS LAYERGROUP
Expand Down

0 comments on commit c3ac948

Please sign in to comment.