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

Commit ffe5e01

Browse files
committed
revert: fix($resource): Route constructor, updated RegExp
This reverts commit 06ed8ef. The reverted commit causes regressions. See comments in the PR: #1402 (comment)
1 parent 3c2e1c5 commit ffe5e01

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

src/ngResource/resource.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ angular.module('ngResource', ['ng']).
290290
this.defaults = defaults || {};
291291
var urlParams = this.urlParams = {};
292292
forEach(template.split(/\W/), function(param){
293-
if (param && (new RegExp("((\\w|\\/|^)(?!\\\\:" + param + ")):" + param + "\\W")).test(template)) {
293+
if (param && template.match(new RegExp("[^\\\\]:" + param + "\\W"))) {
294294
urlParams[param] = true;
295295
}
296296
});

test/ngResource/resourceSpec.js

-6
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,6 @@ describe("resource", function() {
129129
R.get({a: 'doh@fo o', ':bar': '$baz@1', '!do&h': 'g=a h'});
130130
});
131131

132-
it('should allow relative paths in resource url', function () {
133-
var R = $resource(':a');
134-
$httpBackend.expect('GET', 'data.json').respond('{}');
135-
R.get({ a: 'data.json' });
136-
});
137-
138132

139133
it('should encode & in url params', function() {
140134
var R = $resource('/Path/:a');

0 commit comments

Comments
 (0)