snoopysecurity / dvws-node

Damn Vulnerable Web Services is a vulnerable application with a web service and an API that can be used to learn about webservices/API related vulnerabilities.
GNU General Public License v3.0
442 stars 173 forks source link

Errors are not handled properly in controllers/notebook.js #20

Closed tienthanh411 closed 3 years ago

tienthanh411 commented 3 years ago

In various places in controllers/notebook.js, if there is error, the server will try to respond with both the error and the value that is supposed to be sent when there is no error. For example:

https://github.com/snoopysecurity/dvws-node/blob/master/controllers/notebook.js#L52 image

This will result in error: "Error: Can't set headers after they are sent." An "else" statement should be there to prevent such case.

snoopysecurity commented 3 years ago

Hi! thanks for reporting this, i believe it is fixed now, can you try testing this again? thanks

tienthanh411 commented 3 years ago

Thanks! I could see from the code that it is fixed now.