macedigital / express-xml-bodyparser

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

Is this works with gzip requests? #18

Closed brunodomenici closed 5 years ago

brunodomenici commented 6 years ago

Hi,

I need to receive POST requests with gziped XMLs. In my tests, I'm receiving:

{"message":"Non-whitespace before first tag.\nLine: 0\nColumn: 1\nChar: \u001f","status":400}

I suspect that this message is coming from xml2js.

In my project we use compression middleware also, I don't know with this could interfere.

Thank you.

macedigital commented 6 years ago

@brunodomenici In your case, you'll need to add a middleware that de-compresses the request before passing it on to the xml-parser. Unfortunately, I don't know of pre-made ones you could install via npm.

If you need this feature, have a look at unzip-post-body-with-node-express and how-can-i-gunzip-post-request-data-in-express.

brunodomenici commented 5 years ago

Alright, thanks a lot and sorry for delay.