syntex-basic
Advanced tools
Comparing version 1.0.0-b11 to 1.0.0-b12
@@ -1,2 +0,2 @@ | ||
const http = require('http'); | ||
const http = require('http'), https = require('https'); | ||
@@ -14,9 +14,4 @@ module.exports = class RequestManager | ||
if(options.method == null) | ||
if(options.data != null && (options.data instanceof Object || Array.isArray(options.data))) | ||
{ | ||
options.method = options.data != null ? 'POST' : 'GET'; | ||
} | ||
if(options.data != null) | ||
{ | ||
try | ||
@@ -32,4 +27,9 @@ { | ||
var request = http.request(url, options, (response) => { | ||
if(options.method == null) | ||
{ | ||
options.method = options.data != null ? 'POST' : 'GET'; | ||
} | ||
var request = (url.includes('https://') ? https : http).request(url, options, (response) => { | ||
let data = ''; | ||
@@ -66,2 +66,12 @@ | ||
console.log(url, options); | ||
if(options.headers != null) | ||
{ | ||
for(const x in options.headers) | ||
{ | ||
request.setHeader(x, options.headers[x]); | ||
} | ||
} | ||
if(options.data != null) | ||
@@ -68,0 +78,0 @@ { |
{ | ||
"name": "syntex-basic", | ||
"version": "1.0.0-b11", | ||
"version": "1.0.0-b12", | ||
"description": "A basic module for development", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14035
429
2