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

Appends slashes to urls #1064

Closed
wants to merge 1 commit into from
Closed

Appends slashes to urls #1064

wants to merge 1 commit into from

Conversation

umurkontaci
Copy link
Contributor

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
Copy link

m6w6 commented Jul 3, 2012

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

@umurkontaci
Copy link
Contributor Author

#992

@ghost ghost assigned mhevery Sep 4, 2012
@mhevery
Copy link
Contributor

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

@mhevery
Copy link
Contributor

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
@@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants