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

Commit 8991680

Browse files
sudhirjpkozlowski-opensource
authored andcommitted
fix($resource): HTTP method should be case-insensitive
Perform call `angular.uppercase` on all given action methods. Closes #1403
1 parent ec801ac commit 8991680

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/ngResource/resource.js

+1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ angular.module('ngResource', ['ng']).
330330
}
331331

332332
forEach(actions, function(action, name) {
333+
action.method = angular.uppercase(action.method);
333334
var hasBody = action.method == 'POST' || action.method == 'PUT' || action.method == 'PATCH';
334335
Resource[name] = function(a1, a2, a3, a4) {
335336
var params = {};

test/ngResource/resourceSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("resource", function() {
99
$resource = $injector.get('$resource');
1010
CreditCard = $resource('/CreditCard/:id:verb', {id:'@id.key'}, {
1111
charge:{
12-
method:'POST',
12+
method:'post',
1313
params:{verb:'!charge'}
1414
},
1515
patch: {

0 commit comments

Comments
 (0)