New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

browser-http

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-http - npm Package Compare versions

Comparing version
3.0.1
to
3.0.2
+5
-0
lib/Request.js

@@ -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;

{
"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",

@@ -333,3 +333,6 @@ [![NPM version](https://badge.fury.io/js/browser-http.png)](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)