Socket
Socket
Sign inDemoInstall

stackexchange

Package Overview
Dependencies
27
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.4 to 1.2.5

30

lib/post.js

@@ -5,3 +5,3 @@ 'use strict';

, parser = require('./parser')
, request = require('request')
, fetch = require('node-fetch')
, url = require('url');

@@ -21,22 +21,14 @@

// Query against the predefined website and construct the endpoint.
data.site = config.get('site');
var endpoint = url.format({
protocol: config.get('protocol')
, host: config.get('api')
, pathname: '/' + config.get('version') + '/' + destination
});
const endpoint = `${config.get('protocol')}//${config.get('api')}/${config.get('version')}/${destination}`;
// Make a post request on proper response call callback.
request(
{ url: endpoint, encoding: null, method: "POST", form: data }
, function response (error, res) {
if (error) {
callback(error);
}
else {
parser.parseBody.call(this, res.body, callback);
}
}
);
const params = new url.URLSearchParams();
for (const key in data) {
params.append(key, data[key]);
}
fetch(endpoint, { method: 'POST', body: params })
.then((res) => res.buffer())
.then((buffer) => parser.parseBody(buffer, callback))
.catch(callback);
};
{
"name": "stackexchange",
"version": "1.2.4",
"version": "1.2.5",
"description": "Node.js implementation of the stackexchange/stackoverflow API",

@@ -18,4 +18,3 @@ "main": "./lib/stackexchange",

"nconf": "0.8.x",
"node-fetch": "^2.6.1",
"request": "^2.87.0"
"node-fetch": "^2.6.1"
},

@@ -22,0 +21,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc