browser-http
Advanced tools
+5
-0
@@ -30,2 +30,3 @@ (function() { | ||
| function Request(url, type, data, jsonp, jsonPrefix) { | ||
| var _ref; | ||
| this.url = url; | ||
@@ -37,2 +38,6 @@ this.type = type != null ? type : 'GET'; | ||
| Request.__super__.constructor.apply(this, arguments); | ||
| this.type = this.type.toUpperCase(); | ||
| if ((_ref = this.type) !== 'GET' && _ref !== 'POST' && _ref !== 'PUT' && _ref !== 'DELETE' && _ref !== 'HEAD' && _ref !== 'CONNECT' && _ref !== 'OPTIONS' && _ref !== 'TRACE') { | ||
| throw new Error("Http request: type must be GET, POST, PUT, DELETE, HEAD, CONNECT, OPTIONS or TRACE, " + this.type + " given"); | ||
| } | ||
| this.xhr = this.createXhr(this.url, this.type, this.data, this.jsonp, this.jsonPrefix); | ||
@@ -39,0 +44,0 @@ this.response = this.xhr.response; |
+2
-6
@@ -38,3 +38,3 @@ (function() { | ||
| function Xhr(url, type, data, jsonp, jsonPrefix) { | ||
| var method, _ref; | ||
| var method; | ||
| this.url = url; | ||
@@ -47,6 +47,2 @@ this.type = type != null ? type : 'GET'; | ||
| Xhr.COUNTER++; | ||
| this.type = this.type.toUpperCase(); | ||
| if ((_ref = this.type) !== 'GET' && _ref !== 'POST' && _ref !== 'PUT' && _ref !== 'DELETE' && _ref !== 'HEAD' && _ref !== 'CONNECT' && _ref !== 'OPTIONS' && _ref !== 'TRACE') { | ||
| throw new Error("Http request: type must be GET, POST, PUT, DELETE, HEAD, CONNECT, OPTIONS or TRACE, " + this.type + " given"); | ||
| } | ||
| if (this.jsonp !== false) { | ||
@@ -67,3 +63,3 @@ if (this.jsonp === true) { | ||
| this.data = Helpers.buildQuery(this.data); | ||
| if (type !== 'POST') { | ||
| if (this.type !== 'POST') { | ||
| this.url += this.url.indexOf('?') !== -1 ? '&' : '?'; | ||
@@ -70,0 +66,0 @@ this.url += this.data; |
+1
-1
| { | ||
| "name": "browser-http", | ||
| "description": "Simple (but advanced) HTTP for browser", | ||
| "version": "3.0.1", | ||
| "version": "3.0.2", | ||
| "author": { | ||
@@ -6,0 +6,0 @@ "name": "David Kudera", |
+4
-1
@@ -333,3 +333,6 @@ [](http://badge.fury.io/js/browser-http) | ||
| * 3.0.0 | ||
| * 3.0.2 | ||
| + Use upper-cased HTTP methods everywhere [#13](https://github.com/sakren/node-browser-http/issues/13) | ||
| * 3.0.0 - 3.0.1 | ||
| + Updated and optimized all dependencies | ||
@@ -336,0 +339,0 @@ + Added global options [#5](https://github.com/sakren/node-browser-http/issues/5) |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
68260
0.2%1532
0.07%427
0.71%