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

Commit 965976a

Browse files
committed
v0.7.0
1 parent 21b1651 commit 965976a

File tree

5 files changed

+23
-14
lines changed

5 files changed

+23
-14
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vue-resource",
33
"main": "dist/vue-resource.js",
44
"description": "A web request service for Vue.js",
5-
"version": "0.6.1",
5+
"version": "0.7.0",
66
"homepage": "https://github.com/vuejs/vue-resource",
77
"license": "MIT",
88
"ignore": [

dist/vue-resource.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-resource v0.6.1
2+
* vue-resource v0.7.0
33
* https://github.com/vuejs/vue-resource
44
* Released under the MIT License.
55
*/
@@ -715,6 +715,7 @@ return /******/ (function(modules) { // webpackBootstrap
715715
params: {},
716716
headers: {},
717717
xhr: null,
718+
upload: null,
718719
jsonp: 'callback',
719720
beforeSend: null,
720721
crossOrigin: null,
@@ -1157,14 +1158,6 @@ return /******/ (function(modules) { // webpackBootstrap
11571158

11581159
xhr.open(request.method, _.url(request), true);
11591160

1160-
if (_.isPlainObject(request.xhr)) {
1161-
_.extend(xhr, request.xhr);
1162-
}
1163-
1164-
_.each(request.headers || {}, function (value, header) {
1165-
xhr.setRequestHeader(header, value);
1166-
});
1167-
11681161
handler = function (event) {
11691162

11701163
response.data = xhr.responseText;
@@ -1175,9 +1168,24 @@ return /******/ (function(modules) { // webpackBootstrap
11751168
resolve(response);
11761169
};
11771170

1171+
xhr.timeout = 0;
11781172
xhr.onload = handler;
11791173
xhr.onabort = handler;
11801174
xhr.onerror = handler;
1175+
xhr.ontimeout = function () {};
1176+
xhr.onprogress = function () {};
1177+
1178+
if (_.isPlainObject(request.xhr)) {
1179+
_.extend(xhr, request.xhr);
1180+
}
1181+
1182+
if (_.isPlainObject(request.upload)) {
1183+
_.extend(xhr.upload, request.upload);
1184+
}
1185+
1186+
_.each(request.headers || {}, function (value, header) {
1187+
xhr.setRequestHeader(header, value);
1188+
});
11811189

11821190
xhr.send(request.data);
11831191
});

dist/vue-resource.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/http.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ headers | `Object` | Headers object to be sent as HTTP request headers
6868
beforeSend | `function(request)` | Callback function to modify the request object before it is sent
6969
emulateHTTP | `boolean` | Send PUT, PATCH and DELETE requests with a HTTP POST and set the `X-HTTP-Method-Override` header
7070
emulateJSON | `boolean` | Send request data as `application/x-www-form-urlencoded` content type
71-
xhr | `Object` | Parameters object to be set on the native XHR object
71+
xhr | `Object` | Parameters object to be set on the [XHR](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) object
72+
upload | `Object` | Parameters object to be set on the [XHR.upload](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/upload) property
7273
jsonp | `string` | Callback function name in a JSONP request
7374
timeout | `number` | Request timeout in milliseconds (`0` means no timeout)
7475

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-resource",
3-
"version": "0.6.1",
3+
"version": "0.7.0",
44
"description": "A web request service for Vue.js",
55
"main": "src/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)