sample todo-angular responds with 500
Opened this issue · 1 comments
arpl commented
Find bellow the server activity and the callstack.
GET / 304 7ms
GET /css/reset.css 304 4ms
GET /css/toastr.css 304 1ms
GET /css/todo.css 304 2ms
GET /bower_components/angular/angular.js 304 2ms
GET /bower_components/breeze-client/breeze.debug.js 304 2ms
GET /bower_components/jquery/dist/jquery.min.js 304 1ms
GET /bower_components/breeze-client/build/adapters/breeze.bridge.angular.js 304 1ms
GET /bower_components/toastr/toastr.js 304 0ms
GET /bower_components/breeze-client-labs/breeze.savequeuing.js 304 1ms
GET /app/main.js 304 1ms
GET /app/logger.js 304 2ms
GET /app/dataservice.js 304 1ms
GET /app/controller.js 304 2ms
GET /app/view.html 304 0ms
GET /breeze/todos/Metadata 304 4ms
Executing (default): SELECT `Id`, `Description`, `CreatedAt`, `IsDone`, `IsArchived` FROM `TodoItem` AS `TodoItem` WHERE `TodoItem`.`IsArchived`=false ORDER BY `CreatedAt`;
GET /breeze/todos/Todos?%7B%22where%22%3A%7B%22IsArchived%22%3Afalse%7D%2C%22orderBy%22%3A%5B%22CreatedAt%22%5D%7D& 500 17ms - 72b
--------------
Status: 500
{
"message": "Header name must be a valid HTTP Token [\"Content-Type:\"]"
}
TypeError: Header name must be a valid HTTP Token ["Content-Type:"]
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:337:11)
at returnResults (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/routes.js:141:13)
at null.<anonymous> (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/routes.js:136:13)
at tryCatch1 (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/node_modules/sequelize/node_modules/bluebird/js/main/util.js:43:21)
at Promise$_callHandler [as _callHandler] (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:649:13)
at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:663:18)
at Promise$_settlePromiseAt (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:826:14)
at Promise._settlePromiseAt (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/node_modules/sequelize/lib/promise.js:66:18)
at Promise$_settlePromises [as _settlePromises] (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:969:14)
at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/node_modules/sequelize/node_modules/bluebird/js/main/async.js:75:12)
at Async$consumeFunctionBuffer (/Users/devmac/workspace/misc/breeze.js.samples/node/todo-angular/server/node_modules/sequelize/node_modules/bluebird/js/main/async.js:38:14)
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)
fberlin commented
I had the same issue. Apparently a RegExp-validation of "Content-Type:" dislikes the ":"
In todo-angular/server/routes.js
replace:
res.setHeader("Content-Type:", "application/json");
with:
res.setHeader("Content-Type", "application/json");