bi-tm / express-nedb-rest

rest api for nedb database, based on express http server
MIT License
24 stars 13 forks source link

There is an error while delete all doc #3

Closed alexluoli closed 8 years ago

alexluoli commented 8 years ago

Note: express-nedb-rest is running on Electron main process.

when DELETE http://localhost:8080/test

Uncaught Exception: Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:344:11) at ServerResponse.header (/Users/alexluoli/SVN/Medical/Electron/OT-Training/node_modules/express/lib/response.js:719:10) at ServerResponse.contentType (/Users/alexluoli/SVN/Medical/Electron/OT-Training/node_modules/express/lib/response.js:552:15) at ServerResponse.send (/Users/alexluoli/SVN/Medical/Electron/OT-Training/node_modules/express/lib/response.js:139:14) at /Users/alexluoli/SVN/Medical/Electron/OT-Training/node_modules/express-nedb-rest/index.js:236:29 at newArguments.(anonymous function) (/Users/alexluoli/SVN/Medical/Electron/OT-Training/node_modules/nedb/lib/executor.js:29:17) at /Users/alexluoli/SVN/Medical/Electron/OT-Training/node_modules/nedb/lib/datastore.js:693:14 at /Users/alexluoli/SVN/Medical/Electron/OT-Training/node_modules/nedb/lib/persistence.js:201:12 at FSReqWrap.oncomplete (fs.js:123:15)

bi-tm commented 8 years ago

Thank you for your bug report. i will check it soon.

bi-tm commented 8 years ago

DELETE without a filter is not allowed. You'll get a 405 status code. The error, as you described is fixed in v1.1.1