diff options
| author | Sudhir Jonathan | 2012-11-27 11:54:35 +0530 |
|---|---|---|
| committer | Pawel Kozlowski | 2012-11-30 22:58:11 +0100 |
| commit | 8991680d8ab632dda60cd70c780868c803c74509 (patch) | |
| tree | 70f8f12fe480f37a3ee085ff670890e81c9f5048 | |
| parent | ec801ac13782f3f488915d682d6d2a73e2d76efd (diff) | |
| download | angular.js-8991680d8ab632dda60cd70c780868c803c74509.tar.bz2 | |
fix($resource): HTTP method should be case-insensitive
Perform call `angular.uppercase` on all given action methods.
Closes #1403
| -rw-r--r-- | src/ngResource/resource.js | 1 | ||||
| -rw-r--r-- | test/ngResource/resourceSpec.js | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 878a6b6e..4c2a8dc1 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -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 = {}; diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index 3d263688..b9041426 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -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: { |
