Skip to content

Commit 3244f03

Browse files
committed
fix(ngResource): Remove request body from $delete
Prevent the obj.$delete instance method from sending the resource as the request body. This commit uses the existing hasBody boolean to only set httpConfig.data for methods which should have a request body. Closes angular#4280
1 parent 948e8ca commit 3244f03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ngResource/resource.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ angular.module('ngResource', ['ng']).
466466
}
467467
});
468468

469-
httpConfig.data = data;
469+
if (hasBody) httpConfig.data = data;
470470
route.setUrlParams(httpConfig, extend({}, extractParams(data, action.params || {}), params), action.url);
471471

472472
var promise = $http(httpConfig).then(function(response) {

0 commit comments

Comments
 (0)