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

Commit

Permalink
v0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
steffans committed Jul 6, 2015
1 parent 8354f91 commit d2bba90
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue-resource",
"main": "dist/vue-resource.js",
"description": "A web request service for Vue.js",
"version": "0.1.4",
"version": "0.1.5",
"homepage": "https://github.com/vuejs/vue-resource",
"license": "MIT",
"ignore": [
Expand Down
14 changes: 9 additions & 5 deletions dist/vue-resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-resource v0.1.4
* vue-resource v0.1.5
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -350,6 +350,11 @@
Http.options, _.options('http', this, options)
);

if (_.isPlainObject(options.data) && /^(get|jsonp)$/i.test(options.method)) {
_.extend(options.params, options.data);
options.data = '';
}

promise = (options.method.toLowerCase() == 'jsonp' ? jsonp : xhr).call(this, this.$url || Vue.url, options);

_.extend(promise, {
Expand Down Expand Up @@ -404,9 +409,9 @@
options.beforeSend(request, options);
}

if (options.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(options.method)) {
if (options.emulateHTTP && /^(put|patch|delete)$/i.test(options.method)) {
options.headers['X-HTTP-Method-Override'] = options.method;
options.method = 'POST';
options.method = 'post';
}

if (options.emulateJSON && _.isPlainObject(options.data)) {
Expand Down Expand Up @@ -460,7 +465,6 @@

var callback = '_jsonp' + Math.random().toString(36).substr(2), script, result;

_.extend(options.params, options.data);
options.params[options.jsonp] = callback;

if (_.isFunction(options.beforeSend)) {
Expand Down Expand Up @@ -515,7 +519,7 @@
}

Http.options = {
method: 'GET',
method: 'get',
params: {},
data: '',
jsonp: 'callback',
Expand Down
4 changes: 2 additions & 2 deletions dist/vue-resource.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-resource",
"version": "0.1.4",
"version": "0.1.5",
"description": "A web request service for Vue.js",
"main": "src/index.js",
"scripts": {
Expand Down

0 comments on commit d2bba90

Please sign in to comment.