Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample todo-angular responds with 500 #36

Open
arpl opened this issue Jan 17, 2016 · 1 comment
Open

sample todo-angular responds with 500 #36

arpl opened this issue Jan 17, 2016 · 1 comment

Comments

@arpl
Copy link

arpl commented Jan 17, 2016

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
Copy link

fberlin commented Mar 18, 2016

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");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants