Skip to content

Commit

Permalink
Update lib/bindings/HTTPBinding.js
Browse files Browse the repository at this point in the history
Co-authored-by: rg2011 <52279456+rg2011@users.noreply.github.com>
  • Loading branch information
AlvaroVega and rg2011 authored Nov 13, 2023
1 parent 60d81b2 commit 6f7a41c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/bindings/HTTPBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,19 @@ const { promisify } = require('util');
const json = promisify(bodyParser.json({ strict: false })); // accept anything JSON.parse accepts.
const text = promisify(bodyParser.text());
const raw = promisify(bodyParser.raw());
const xml = promisify(bodyParser.xml());
const xml2js = require('xml2js');
const xmlStripPrefix = xml2js.processors.stripPrefix;
const xml = promisify(bodyParser.xml({
xmlParseOptions: {
// XML namespaces might change from one request to the next.
// It is useful to remove them from the document,
// to be able to refer to tags later in JEXL transformations.
// See https://github.com/Leonidas-from-XIV/node-xml2js/issues/87
tagNameProcessors: [xmlStripPrefix],
attrNameProcessors: [xmlStripPrefix]
}
})
);

function parserBody() {
// generic bodyParser
Expand Down

0 comments on commit 6f7a41c

Please sign in to comment.