Appends slashes to urls #1064

wants to merge 1 commit into


None yet
5 participants

umurkontaci commented Jun 17, 2012

Angular intenionally removes slashes from urls defined in ngResource and this causes bugs and problems in frameworks like django. It simply adds slashes to urls for it work.

m6w6 commented Jul 3, 2012

wat? A slash after the query? That doesn't look right.


umurkontaci commented Jul 3, 2012

@ghost ghost assigned mhevery Sep 4, 2012


mhevery commented Sep 4, 2012

Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement).

CLA is important for us to be able to avoid legal troubles down the road.

For individuals (a simple click-through form):

For corporations (print, sign and scan+email, fax or mail):


mhevery commented Sep 4, 2012

So after thinking about this some more, we are not going to accept this. Here are the reasons

@mhevery mhevery closed this Sep 4, 2012

@tryggve tryggve referenced this pull request in ProReNata/Survey Oct 29, 2012


Append slash creates problems with POST #1

@@ -295,7 +295,7 @@ angular.module('ngResource', ['ng']).
url = url.replace(/\/*$/, '');
- return url + (query.length ? '?' + query.join('&') : '');
+ return url + (query.length ? '?' + query.join('&') : '') + '/'; // append slashes to urls

korotkin Aug 2, 2013

Are you sure? You append a slash at the end of the url.

return url + (query.length ? '?' + query.join('&') : '') + '/';

I would made a bid for a line 297


umurkontaci Aug 2, 2013


This is an old pull request has been rejected already, I've made a local fix for django users but raises other issues.


FoysalOsmany Sep 9, 2014

Still facing the trailing slash issue with Django Rest Framework with Angular Resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment