macedigital / express-xml-bodyparser

Simple XML body parser connect/express middleware
MIT License
69 stars 27 forks source link

xml-body-parser returning errors- #15

Closed SameerSiddiqui closed 7 years ago

SameerSiddiqui commented 7 years ago

I use xml-body-parser in my middleware-

With version 0.2.2 xml body parser use to work fine- Every time a client use to provide invalid xml. Parser use to work perfectly with our middleware chain. Now as soon as i have update to 0.3.0. I am getting exception from my application-

Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:356:11)

When i go back to previous version 0.2.2 i no longer get the above exception and errors are handled by my next function in line in the middleware.

Is there any specific change that was done between these versions ?

SameerSiddiqui commented 7 years ago

Never mind- i set the async=false and it worked!

macedigital commented 7 years ago

@SameerSiddiqui Glad I could help 😄 Unfortunately, async=true still has some issues, so it's recommended to turn it off.