httpinvoke
Advanced tools
Comparing version 1.3.4 to 1.3.5
{ | ||
"name": "httpinvoke", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"main": "httpinvoke-browser.js", | ||
@@ -5,0 +5,0 @@ "description": "A no-dependencies HTTP client library for browsers and Node.js with a promise-based or Node.js-style callback-based API to progress events, text and binary file upload and download, partial response body, request and response headers, status code.", |
{ | ||
"name": "httpinvoke", | ||
"repo": "jakutis/httpinvoke", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"description": "A no-dependencies HTTP client library for browsers and Node.js with a promise-based or Node.js-style callback-based API to progress events, text and binary file upload and download, partial response body, request and response headers, status code.", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -116,3 +116,4 @@ var fs = require('fs'); | ||
global: true, | ||
require: true | ||
require: true, | ||
JSON: true | ||
} | ||
@@ -124,3 +125,6 @@ }, | ||
options: { | ||
node: true | ||
node: true, | ||
globals: { | ||
JSON: true | ||
} | ||
}, | ||
@@ -127,0 +131,0 @@ src: ['./Gruntfile.js', './karma.conf.js', './dummyserver.js', './demo/index.js', './src/node.js', './src/commonjs.js'] |
var http = require('http'); | ||
var https = require('https'); | ||
var url = require('url'); | ||
@@ -461,3 +462,11 @@ var zlib = require('zlib'); | ||
uri = url.parse(uri); | ||
var req = http.request({ | ||
var request = null; | ||
if(uri.protocol === 'http:') { | ||
request = http.request.bind(http); | ||
} else if(uri.protocol === 'https:') { | ||
request = https.request.bind(https); | ||
} else { | ||
return failWithoutRequest(cb, new Error('protocol ' + uri.protocol + ' is not among these supported protocols: http:, https:')); | ||
} | ||
var req = request({ | ||
hostname: uri.hostname, | ||
@@ -464,0 +473,0 @@ port: Number(uri.port), |
{ | ||
"name": "httpinvoke", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"description": "A no-dependencies HTTP client library for browsers and Node.js with a promise-based or Node.js-style callback-based API to progress events, text and binary file upload and download, partial response body, request and response headers, status code.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
var http = require('http'); | ||
var https = require('https'); | ||
var url = require('url'); | ||
@@ -89,3 +90,11 @@ var zlib = require('zlib'); | ||
uri = url.parse(uri); | ||
var req = http.request({ | ||
var request = null; | ||
if(uri.protocol === 'http:') { | ||
request = http.request.bind(http); | ||
} else if(uri.protocol === 'https:') { | ||
request = https.request.bind(https); | ||
} else { | ||
return failWithoutRequest(cb, new Error('protocol ' + uri.protocol + ' is not among these supported protocols: http:, https:')); | ||
} | ||
var req = request({ | ||
hostname: uri.hostname, | ||
@@ -92,0 +101,0 @@ port: Number(uri.port), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
407356
8778
9