Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix($resource): HTTP method should be case-insensitive
Browse files Browse the repository at this point in the history
Perform call `angular.uppercase` on all given action methods.

Closes #1403
  • Loading branch information
sudhirj authored and pkozlowski-opensource committed Nov 30, 2012
1 parent ec801ac commit 8991680
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ngResource/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ angular.module('ngResource', ['ng']).
}

forEach(actions, function(action, name) {
action.method = angular.uppercase(action.method);
var hasBody = action.method == 'POST' || action.method == 'PUT' || action.method == 'PATCH';
Resource[name] = function(a1, a2, a3, a4) {
var params = {};
Expand Down
2 changes: 1 addition & 1 deletion test/ngResource/resourceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("resource", function() {
$resource = $injector.get('$resource');
CreditCard = $resource('/CreditCard/:id:verb', {id:'@id.key'}, {
charge:{
method:'POST',
method:'post',
params:{verb:'!charge'}
},
patch: {
Expand Down

0 comments on commit 8991680

Please sign in to comment.