-
Notifications
You must be signed in to change notification settings - Fork 27.4k
$resource loses its URL's trailing slash #2589
Comments
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 |
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 ( Thanks! |
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. |
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? |
We just ran into this as well. Our API is built on Django and requires slashes. Please reopen this! Thanks! |
I believe #5560 is related to this, and possibly fixes it |
@caitp 👍 Thats a great feature option |
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. |
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.
The text was updated successfully, but these errors were encountered: