sync-request
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -8,3 +8,3 @@ 'use strict'; | ||
function doRequest(method, url, options) { | ||
var xhr = new window.XMLHttpRequest(); | ||
var xhr = new XMLHttpRequest(); | ||
@@ -32,3 +32,3 @@ // check types of arguments | ||
var match; | ||
var crossDomain = !!((match = /^([\w-]+:)?\/\/([^\/]+)/.exec(options.uri)) && (match[2] != window.location.host)); | ||
var crossDomain = !!((match = /^([\w-]+:)?\/\/([^\/]+)/.exec(options.uri)) && (match[2] != location.host)); | ||
if (!crossDomain) options.headers['X-Requested-With'] = 'XMLHttpRequest'; | ||
@@ -35,0 +35,0 @@ |
{ | ||
"name": "sync-request", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Make synchronous web requests", | ||
@@ -5,0 +5,0 @@ "browser": "./browser.js", |
@@ -8,3 +8,3 @@ # sync-request | ||
[![Build Status](https://img.shields.io/travis/ForbesLindesay/sync-request/master.svg)](https://travis-ci.org/ForbesLindesay/sync-request) | ||
[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/sync-request.svg)](https://gemnasium.com/ForbesLindesay/sync-request) | ||
[![Dependency Status](https://img.shields.io/david/ForbesLindesay/sync-request.svg)](https://david-dm.org/ForbesLindesay/sync-request) | ||
[![NPM version](https://img.shields.io/npm/v/sync-request.svg)](https://www.npmjs.org/package/sync-request) | ||
@@ -11,0 +11,0 @@ |
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
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
17124