coolaj86/dropshare — Issue #32: Posing bogus data to /meta/new kills node
Author: jergason
Created: 2012-03-02 23:06:02+00:00
State: open
Labels: Bug

How to reproduce:

```bash
node run-server.js
```

In a separate terminal, run this:

```bash
curl localhost:3700/meta/new -X POST -H "Content-Type: application/json" -d '{"HURPDURP":1}'
```

What I saw in the window running node:

```bash
Error: bad arg
at Socket.write (net.js:416:13)
at ServerResponse.end (http.js:680:29)
at Object.createIds (/Users/jergason/Dropbox/code/dropshare/lib/index.js:40:11)
at nextMiddleware (/Users/jergason/Dropbox/code/dropshare/node_modules/connect/lib/middleware/router.js:175:25)
at param (/Users/jergason/Dropbox/code/dropshare/node_modules/connect/lib/middleware/router.js:183:16)
at pass (/Users/jergason/Dropbox/code/dropshare/node_modules/connect/lib/middleware/router.js:191:10)
at Object.router [as handle] (/Users/jergason/Dropbox/code/dropshare/node_modules/connect/lib/middleware/router.js:197:6)
at next (/Users/jergason/Dropbox/code/dropshare/node_modules/connect/lib/http.js:203:15)
at Object.query [as handle] (/Users/jergason/Dropbox/code/dropshare/node_modules/connect/lib/middleware/query.js:38:5)
at next (/Users/jergason/Dropbox/code/dropshare/node_modules/connect/lib/http.js:203:15)
```

What I expected to see: The server should not crash, but should return an error to the client.