diff options
| author | Gias Kay Lee | 2013-12-20 23:15:46 +0800 | 
|---|---|---|
| committer | Igor Minar | 2014-01-02 23:07:27 -0800 | 
| commit | 131e4014b831ac81b7979c4523da81ebc5861c70 (patch) | |
| tree | 8f4e73fb8e3e5e939f930ba956c73dd3fb1997dc /src/ngResource/resource.js | |
| parent | 01c5be4681e34cdc5f5c461b7a618fefe8038919 (diff) | |
| download | angular.js-131e4014b831ac81b7979c4523da81ebc5861c70.tar.bz2 | |
fix($resource): prevent URL template from collapsing into an empty string
if url template would result in an empty string, we should make a request
to '/' instead.
Closes #5455
Closes #5493
Diffstat (limited to 'src/ngResource/resource.js')
| -rw-r--r-- | src/ngResource/resource.js | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index dedbf860..8874bbec 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -401,7 +401,7 @@ angular.module('ngResource', ['ng']).          });          // strip trailing slashes and set the url -        url = url.replace(/\/+$/, ''); +        url = url.replace(/\/+$/, '') || '/';          // then replace collapse `/.` if found in the last URL path segment before the query          // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`          url = url.replace(/\/\.(?=\w+($|\?))/, '.'); | 
