Appends slashes to urls #1064

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants
Contributor

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.

Contributor

umurkontaci commented Jul 3, 2012

@ghost ghost assigned mhevery Sep 4, 2012

Owner

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):
http://code.google.com/legal/individual-cla-v1.0.html

For corporations (print, sign and scan+email, fax or mail):
http://code.google.com/legal/corporate-cla-v1.0.html

Owner

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

Open

Append slash creates problems with POST #1

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

korotkin Aug 2, 2013

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

return url + (query.length ? '?' + query.join('&') : '') + '/';
foo?query1=1&query2=2/

I would made a bid for a line 297

@umurkontaci

umurkontaci Aug 2, 2013

Contributor

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

@FoysalOsmany

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