Expect malformed response objects (#109)

Include test for sql errors on layergroup creation
Closes #109
This commit is contained in:
Sandro Santilli
2014-01-15 11:53:19 +01:00
parent b01ce9d4cc
commit f89fd98ed7
2 changed files with 42 additions and 3 deletions
+5 -3
View File
@@ -46,13 +46,15 @@ var CartodbWindshaft = function(serverOptions) {
// See http://github.com/CartoDB/Windshaft-cartodb/issues/107
var ws_sendError = ws.sendError;
ws.sendError = function(res) {
// NOTE: the "res" object will have no _headers when
// faked by Windshaft, see
// http://github.com/CartoDB/Windshaft-cartodb/issues/109
//
if ( res._headers ) {
delete res._headers['cache-control'];
delete res._headers['last-modified'];
delete res._headers['x-cache-channel'];
} else {
console.log("WARNING: response has no _headers: "); console.dir(res);
}
}
ws_sendError.apply(this, arguments);
};