{"action":"created","issue":{"url":"https://api.github.com/repos/pouchdb/express-pouchdb/issues/159","labels_url":"https://api.github.com/repos/pouchdb/express-pouchdb/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb/express-pouchdb/issues/159/comments","events_url":"https://api.github.com/repos/pouchdb/express-pouchdb/issues/159/events","html_url":"https://github.com/pouchdb/express-pouchdb/issues/159","id":52827881,"number":159,"title":"Invalid JSON body makes server crash","user":{"login":"marten-de-vries","id":1750170,"avatar_url":"https://avatars.githubusercontent.com/u/1750170?v=3","gravatar_id":"","url":"https://api.github.com/users/marten-de-vries","html_url":"https://github.com/marten-de-vries","followers_url":"https://api.github.com/users/marten-de-vries/followers","following_url":"https://api.github.com/users/marten-de-vries/following{/other_user}","gists_url":"https://api.github.com/users/marten-de-vries/gists{/gist_id}","starred_url":"https://api.github.com/users/marten-de-vries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marten-de-vries/subscriptions","organizations_url":"https://api.github.com/users/marten-de-vries/orgs","repos_url":"https://api.github.com/users/marten-de-vries/repos","events_url":"https://api.github.com/users/marten-de-vries/events{/privacy}","received_events_url":"https://api.github.com/users/marten-de-vries/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pouchdb/express-pouchdb/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-12-24T16:53:02Z","updated_at":"2015-01-03T09:39:49Z","closed_at":"2015-01-03T09:39:49Z","body":"Reported by @Rybadour:\r\n'Agreed, when the body is JSON and it's not perfect the whole server goes down with an error like this:\r\n\r\n```\r\n/home/ryan/projects/websweet/api/node_modules/express-pouchdb/lib/utils.js:53\r\nvar rawPath = req.originalUrl.slice(req.baseUrl.length);\r\n^\r\nTypeError: Cannot read property 'length' of undefined\r\nat Object.exports.rawPath (/home/ryan/projects/websweet/api/node_modules/express-pouchdb/lib/utils.js:53:50)\r\nat Array.1 (/home/ryan/projects/websweet/api/node_modules/express-pouchdb/lib/routes/http_log.js:21:31)\r\nat listener (/home/ryan/projects/websweet/api/node_modules/morgan/node_modules/on-finished/index.js:164:15)\r\nat onFinish (/home/ryan/projects/websweet/api/node_modules/morgan/node_modules/on-finished/index.js:95:5)\r\nat callback (/home/ryan/projects/websweet/api/node_modules/morgan/node_modules/on-finished/node_modules/ee-first/index.js:33:10)\r\nat ServerResponse.onevent (/home/ryan/projects/websweet/api/node_modules/morgan/node_modules/on-finished/node_modules/ee-first/index.js:66:5)\r\nat ServerResponse.EventEmitter.emit (events.js:117:20)\r\nat ServerResponse.OutgoingMessage._finish (http.js:1018:8)\r\nat ServerResponse.OutgoingMessage.end (http.js:1001:10)\r\nat ServerResponse.res.end (/home/ryan/projects/websweet/api/node_modules/express-pouchdb/node_modules/compression/index.js:115:15)\r\n```\r\n\r\nThat's kinda unacceptable.'"},"comment":{"url":"https://api.github.com/repos/pouchdb/express-pouchdb/issues/comments/68589026","html_url":"https://github.com/pouchdb/express-pouchdb/issues/159#issuecomment-68589026","issue_url":"https://api.github.com/repos/pouchdb/express-pouchdb/issues/159","id":68589026,"user":{"login":"marten-de-vries","id":1750170,"avatar_url":"https://avatars.githubusercontent.com/u/1750170?v=3","gravatar_id":"","url":"https://api.github.com/users/marten-de-vries","html_url":"https://github.com/marten-de-vries","followers_url":"https://api.github.com/users/marten-de-vries/followers","following_url":"https://api.github.com/users/marten-de-vries/following{/other_user}","gists_url":"https://api.github.com/users/marten-de-vries/gists{/gist_id}","starred_url":"https://api.github.com/users/marten-de-vries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marten-de-vries/subscriptions","organizations_url":"https://api.github.com/users/marten-de-vries/orgs","repos_url":"https://api.github.com/users/marten-de-vries/repos","events_url":"https://api.github.com/users/marten-de-vries/events{/privacy}","received_events_url":"https://api.github.com/users/marten-de-vries/received_events","type":"User","site_admin":false},"created_at":"2015-01-03T09:39:49Z","updated_at":"2015-01-03T09:39:49Z","body":"Fixed: fc5e5c87c8f4c5d369036bc7da21f8f0d491709e\r\n\r\nThanks for reporting and all the info, @Rybadour!"}}