Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xhr

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xhr - npm Package Compare versions

Comparing version 2.3.1 to 2.3.2

.travis.yml

17

index.js

@@ -91,11 +91,2 @@ "use strict";

var failureResponse = {
body: undefined,
headers: {},
statusCode: 0,
method: method,
url: uri,
rawRequest: xhr
}
function errorFunc(evt) {

@@ -161,2 +152,10 @@ clearTimeout(timeoutTimer)

var timeoutTimer
var failureResponse = {
body: undefined,
headers: {},
statusCode: 0,
method: method,
url: uri,
rawRequest: xhr
}

@@ -163,0 +162,0 @@ if ("json" in options && options.json !== false) {

{
"name": "xhr",
"version": "2.3.1",
"version": "2.3.2",
"description": "small xhr abstraction",

@@ -5,0 +5,0 @@ "keywords": [

@@ -44,2 +44,13 @@ var window = require("global/window")

test("[func] Request to domain with not allowed cross-domain", function(assert) {
xhr({
uri: "http://www.mocky.io/v2/57bb70c21000002f175850bd",
}, function(err, resp, body) {
assert.ok(err instanceof Error, "should return error")
assert.equal(resp.statusCode, 0)
assert.equal(typeof resp.rawRequest, "object")
assert.end()
})
})
test("[func] Returns a falsy body for 204 responses", function(assert) {

@@ -46,0 +57,0 @@ xhr({

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc