Skip to content

Commit

Permalink
fix: resolve body in a request is empty when content-type is XML
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Oct 26, 2021
1 parent f63be17 commit d7eabc3
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,17 @@ require('dotenv').config()
app.use(compress());
app.use(flash());
app.use(express.static('public'));
app.use(bodyParser.urlencoded({
app.use(express.urlencoded({
extended: true
}));
app.use(bodyParser.json());
app.use(bodyParser.json({
app.use(express.json());
app.use(express.json({
"type": "application/fhir+json"
}));
app.use(bodyParser.text({
"type": "text/*"
}));
app.use(bodyParser.raw({
"type": "multipart/related",
limit: "1000mb"
}));
app.use(bodyParser.raw({
"type": "multipart/form-data",
limit: "1000mb"
app.use(express.text({
"type": ["text/*", "/_xml", "xml", "+xml"]
}));

app.use((err, req, res, next) => {
// This check makes sure this is a JSON parsing issue, but it might be
// coming from any middleware, not just body-parser:
Expand Down

0 comments on commit d7eabc3

Please sign in to comment.