You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
When I define a $resource with a URL with trailing slash (e.g. '/ajax/') and then use it, Angular tries to fetch just '/ajax' at first, then it gets a HTTP redirect from Apache to '/ajax/', then it uses the correct URL.
angular ngResource default behavior removes any trailing slashes off the end of a url, why not define the url w/o the trailing slash and prevent apache .htaccess from redirecting?
@andredublin
Thank you for response. In fact, there is no .htaccess there, there is a directory called "ajax" where index.php file is located, I can use "ajax/index.php" but considering that index.php is the default execution handler when it exists, I would prefer just "ajax/", this is a valid URL, isn't it? Why should ngResource remove the trailing slash?
Activity
andredublin commentedon May 6, 2013
angular ngResource default behavior removes any trailing slashes off the end of a url, why not define the url w/o the trailing slash and prevent apache .htaccess from redirecting?
temporaryaccount commentedon May 7, 2013
@andredublin
Thank you for response. In fact, there is no .htaccess there, there is a directory called "ajax" where index.php file is located, I can use "ajax/index.php" but considering that index.php is the default execution handler when it exists, I would prefer just "ajax/", this is a valid URL, isn't it? Why should ngResource remove the trailing slash?
btford commentedon Aug 24, 2013
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.
Please try the newest versions of Angular (
1.0.8and1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.Thanks!
jarmani commentedon Sep 11, 2013
Still the case in 1.2.0-rc.2 and master https://github.com/angular/angular.js/blob/master/src/ngResource/resource.js#L374
This behavior is really annoying as some API around require the ending slash.
What's the benefit of removing it ?
jtangelder commentedon Nov 6, 2013
I'm having the same issue. Removing the line (now at https://github.com/angular/angular.js/blob/master/src/ngResource/resource.js#L388) fixes this problem. Why not make it an option?
caitp commentedon Mar 6, 2014
I believe #5560 is related to this, and possibly fixes it
andredublin commentedon Mar 6, 2014
@caitp 👍 Thats a great feature option
linclark commentedon Mar 14, 2014
As caitp points out, this looks like the same issue as #5560. Since folks are working on a solution there, closing this as a duplicate.