Skip to content

Commit

Permalink
remove unused parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav committed Jan 9, 2024
1 parent b2ec956 commit 7eb584a
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions lib/routes/bins/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,11 @@ const validate = require("har-validator");
module.exports = function (req, res, next) {
const id = req.params.uuid;
let mock = req.jsonBody;

// check for full HAR
if (req.jsonBody?.response) {
mock = req.jsonBody.response;
}

// exception for the web Form
// TODO eliminate this and rely on req.simple.postData.text
if (req.simple.postData.params?.response) {
try {
mock = JSON.parse(req.simple.postData.params.response);
} catch (e) {
debug(e);
}
if (!mock) {
res.body = {
errors: "Response HAR is required",
};
next();
}

// overritten by application/x-www-form-urlencoded or multipart/form-data
Expand Down

0 comments on commit 7eb584a

Please sign in to comment.