Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
steffans committed Feb 2, 2017
2 parents 1e9b78c + d08bc27 commit 37df5c7
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 103 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ $ bower install vue-resource
```

### CDN
Available on [jsdelivr](https://cdn.jsdelivr.net/vue.resource/1.1.1/vue-resource.min.js), [cdnjs](https://cdnjs.com/libraries/vue-resource) or [unpkg](https://unpkg.com/[email protected].1/dist/vue-resource.min.js).
Available on [jsdelivr](https://cdn.jsdelivr.net/vue.resource/1.1.2/vue-resource.min.js), [cdnjs](https://cdnjs.com/libraries/vue-resource) or [unpkg](https://unpkg.com/[email protected].2/dist/vue-resource.min.js).
```html
<script src="https://cdn.jsdelivr.net/vue.resource/1.1.1/vue-resource.min.js"></script>
<script src="https://cdn.jsdelivr.net/vue.resource/1.1.2/vue-resource.min.js"></script>
```

## Example
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-resource",
"main": "dist/vue-resource.js",
"version": "1.1.1",
"version": "1.1.2",
"description": "The HTTP client for Vue.js",
"homepage": "https://github.com/vuejs/vue-resource",
"license": "MIT",
Expand Down
44 changes: 19 additions & 25 deletions dist/vue-resource.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.1.1
* vue-resource v1.1.2
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -270,6 +270,8 @@ var hasOwnProperty = ref.hasOwnProperty;
var ref$1 = [];
var slice = ref$1.slice;

var inBrowser = typeof window !== 'undefined';

var Util = function (Vue) {
util = Vue.util;
debug = Vue.config.debug || !Vue.config.silent;
Expand Down Expand Up @@ -309,9 +311,7 @@ function isString(val) {
return typeof val === 'string';
}

function isBoolean(val) {
return val === true || val === false;
}


function isFunction(val) {
return typeof val === 'function';
Expand Down Expand Up @@ -639,9 +639,6 @@ var template = function (options) {
* Service for URL templating.
*/

var ie = document.documentMode;
var el = document.createElement('a');

function Url(url, params) {

var self = this || {}, options$$1 = url, transform;
Expand Down Expand Up @@ -711,7 +708,9 @@ Url.params = function (obj) {

Url.parse = function (url) {

if (ie) {
var el = document.createElement('a');

if (document.documentMode) {
el.href = url;
url = el.href;
}
Expand Down Expand Up @@ -801,34 +800,29 @@ var xdrClient = function (request) {
* CORS Interceptor.
*/

var ORIGIN_URL = Url.parse(location.href);
var SUPPORTS_CORS = 'withCredentials' in new XMLHttpRequest();
var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();

var cors = function (request, next) {

if (!isBoolean(request.crossOrigin) && crossOrigin(request)) {
request.crossOrigin = true;
}
if (inBrowser) {

if (request.crossOrigin) {
var orgUrl = Url.parse(location.href);
var reqUrl = Url.parse(request.getUrl());

if (!SUPPORTS_CORS) {
request.client = xdrClient;
}
if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {

delete request.emulateHTTP;
request.crossOrigin = true;
request.emulateHTTP = false;

if (!SUPPORTS_CORS) {
request.client = xdrClient;
}
}
}

next();
};

function crossOrigin(request) {

var requestUrl = Url.parse(Url(request));

return (requestUrl.protocol !== ORIGIN_URL.protocol || requestUrl.host !== ORIGIN_URL.host);
}

/**
* Body Interceptor.
*/
Expand Down
44 changes: 19 additions & 25 deletions dist/vue-resource.es2015.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.1.1
* vue-resource v1.1.2
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -268,6 +268,8 @@ var hasOwnProperty = ref.hasOwnProperty;
var ref$1 = [];
var slice = ref$1.slice;

var inBrowser = typeof window !== 'undefined';

var Util = function (Vue) {
util = Vue.util;
debug = Vue.config.debug || !Vue.config.silent;
Expand Down Expand Up @@ -307,9 +309,7 @@ function isString(val) {
return typeof val === 'string';
}

function isBoolean(val) {
return val === true || val === false;
}


function isFunction(val) {
return typeof val === 'function';
Expand Down Expand Up @@ -637,9 +637,6 @@ var template = function (options) {
* Service for URL templating.
*/

var ie = document.documentMode;
var el = document.createElement('a');

function Url(url, params) {

var self = this || {}, options$$1 = url, transform;
Expand Down Expand Up @@ -709,7 +706,9 @@ Url.params = function (obj) {

Url.parse = function (url) {

if (ie) {
var el = document.createElement('a');

if (document.documentMode) {
el.href = url;
url = el.href;
}
Expand Down Expand Up @@ -799,34 +798,29 @@ var xdrClient = function (request) {
* CORS Interceptor.
*/

var ORIGIN_URL = Url.parse(location.href);
var SUPPORTS_CORS = 'withCredentials' in new XMLHttpRequest();
var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();

var cors = function (request, next) {

if (!isBoolean(request.crossOrigin) && crossOrigin(request)) {
request.crossOrigin = true;
}
if (inBrowser) {

if (request.crossOrigin) {
var orgUrl = Url.parse(location.href);
var reqUrl = Url.parse(request.getUrl());

if (!SUPPORTS_CORS) {
request.client = xdrClient;
}
if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {

delete request.emulateHTTP;
request.crossOrigin = true;
request.emulateHTTP = false;

if (!SUPPORTS_CORS) {
request.client = xdrClient;
}
}
}

next();
};

function crossOrigin(request) {

var requestUrl = Url.parse(Url(request));

return (requestUrl.protocol !== ORIGIN_URL.protocol || requestUrl.host !== ORIGIN_URL.host);
}

/**
* Body Interceptor.
*/
Expand Down
44 changes: 19 additions & 25 deletions dist/vue-resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-resource v1.1.1
* vue-resource v1.1.2
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -274,6 +274,8 @@ var hasOwnProperty = ref.hasOwnProperty;
var ref$1 = [];
var slice = ref$1.slice;

var inBrowser = typeof window !== 'undefined';

var Util = function (Vue) {
util = Vue.util;
debug = Vue.config.debug || !Vue.config.silent;
Expand Down Expand Up @@ -313,9 +315,7 @@ function isString(val) {
return typeof val === 'string';
}

function isBoolean(val) {
return val === true || val === false;
}


function isFunction(val) {
return typeof val === 'function';
Expand Down Expand Up @@ -643,9 +643,6 @@ var template = function (options) {
* Service for URL templating.
*/

var ie = document.documentMode;
var el = document.createElement('a');

function Url(url, params) {

var self = this || {}, options$$1 = url, transform;
Expand Down Expand Up @@ -715,7 +712,9 @@ Url.params = function (obj) {

Url.parse = function (url) {

if (ie) {
var el = document.createElement('a');

if (document.documentMode) {
el.href = url;
url = el.href;
}
Expand Down Expand Up @@ -805,34 +804,29 @@ var xdrClient = function (request) {
* CORS Interceptor.
*/

var ORIGIN_URL = Url.parse(location.href);
var SUPPORTS_CORS = 'withCredentials' in new XMLHttpRequest();
var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();

var cors = function (request, next) {

if (!isBoolean(request.crossOrigin) && crossOrigin(request)) {
request.crossOrigin = true;
}
if (inBrowser) {

if (request.crossOrigin) {
var orgUrl = Url.parse(location.href);
var reqUrl = Url.parse(request.getUrl());

if (!SUPPORTS_CORS) {
request.client = xdrClient;
}
if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {

delete request.emulateHTTP;
request.crossOrigin = true;
request.emulateHTTP = false;

if (!SUPPORTS_CORS) {
request.client = xdrClient;
}
}
}

next();
};

function crossOrigin(request) {

var requestUrl = Url.parse(Url(request));

return (requestUrl.protocol !== ORIGIN_URL.protocol || requestUrl.host !== ORIGIN_URL.host);
}

/**
* Body Interceptor.
*/
Expand Down
Loading

0 comments on commit 37df5c7

Please sign in to comment.