Skip to content

Commit

Permalink
fixes sanitization so that we can actually use this package again
Browse files Browse the repository at this point in the history
  • Loading branch information
itsthatguy committed May 31, 2019
1 parent 37de803 commit 7a09847
Show file tree
Hide file tree
Showing 2 changed files with 342 additions and 45 deletions.
13 changes: 9 additions & 4 deletions lib/Request.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var needle = require('needle'),
URL = require('url'),
libxml = require('libxmljs-dom'),
var needle = require('needle'),
URL = require('url'),
libxml = require('libxmljs-dom'),
sanitizeHtml = require('sanitize-html');

/**
Expand Down Expand Up @@ -97,7 +97,12 @@ function Request(method, url, params, opts, tries, callback) {

next(opts.process_response(data, res));
} else {
next(data);
const cleanData = sanitizeHtml(data, {
allowedTags: false,
allowedAttributes: false,
selfClosing: [],
});
next(cleanData);
}

})
Expand Down
Loading

0 comments on commit 7a09847

Please sign in to comment.