{"action":"closed","issue":{"url":"https://api.github.com/repos/hoodiehq/hoodie-server/issues/329","labels_url":"https://api.github.com/repos/hoodiehq/hoodie-server/issues/329/labels{/name}","comments_url":"https://api.github.com/repos/hoodiehq/hoodie-server/issues/329/comments","events_url":"https://api.github.com/repos/hoodiehq/hoodie-server/issues/329/events","html_url":"https://github.com/hoodiehq/hoodie-server/issues/329","id":47821520,"number":329,"title":"Server crashes after a while when using cross-domain","user":{"login":"xMartin","id":112532,"avatar_url":"https://avatars.githubusercontent.com/u/112532?v=3","gravatar_id":"","url":"https://api.github.com/users/xMartin","html_url":"https://github.com/xMartin","followers_url":"https://api.github.com/users/xMartin/followers","following_url":"https://api.github.com/users/xMartin/following{/other_user}","gists_url":"https://api.github.com/users/xMartin/gists{/gist_id}","starred_url":"https://api.github.com/users/xMartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xMartin/subscriptions","organizations_url":"https://api.github.com/users/xMartin/orgs","repos_url":"https://api.github.com/users/xMartin/repos","events_url":"https://api.github.com/users/xMartin/events{/privacy}","received_events_url":"https://api.github.com/users/xMartin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2014-11-05T10:35:37Z","updated_at":"2015-11-26T17:22:22Z","closed_at":"2015-11-26T17:22:21Z","body":"Running Hoodie with server 2.0.0 the process crashes after a while with the following error. This only happens when using it with CORS, client being served on another domain than server.\r\n\r\n\tDebug: hapi, internal, implementation, error \r\n\t\tTypeError: Cannot call method 'code' of undefined\r\n\t\tat internals.addCorsAndBearerToken (.../hoodie/node_modules/hoodie-server/lib/server/plugins/api/index.js:32:18)\r\n\t\tat .../hoodie/node_modules/hoodie-server/node_modules/hapi/node_modules/h2o2/lib/index.js:139:52\r\n\t\tat finish (.../hoodie/node_modules/hoodie-server/node_modules/wreck/lib/index.js:92:20)\r\n\t\tat wrapped (.../hoodie/node_modules/hoodie-server/node_modules/wreck/node_modules/hoek/lib/index.js:771:20)\r\n\t\tat ClientRequest.onError (.../hoodie/node_modules/hoodie-server/node_modules/wreck/lib/index.js:101:16)\r\n\t\tat ClientRequest.g (events.js:180:16)\r\n\t\tat ClientRequest.emit (events.js:117:20)\r\n\t\tat Socket.socketErrorListener (http.js:1551:9)\r\n\t\tat Socket.emit (events.js:95:17)\r\n\t\tat net.js:440:14"}}