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

$resource loses its URL's trailing slash #2589

Closed

Description

@temporaryaccount

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.

Activity

  1. andredublin commented on May 6, 2013

    @andredublin

    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?

  2. temporaryaccount commented on May 7, 2013

    @temporaryaccount
    Author

    @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?

  3. btford commented on Aug 24, 2013

    @btford
    Contributor

    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.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.

    Thanks!

  4. jarmani commented on Sep 11, 2013

    @jarmani

    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 ?

  5. jtangelder commented on Nov 6, 2013

    @jtangelder
    Contributor

    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?

  6. reopened this on Mar 6, 2014
  7. caitp commented on Mar 6, 2014

    @caitp
    Contributor

    I believe #5560 is related to this, and possibly fixes it

  8. andredublin commented on Mar 6, 2014

    @andredublin

    @caitp 👍 Thats a great feature option

  9. linclark commented on Mar 14, 2014

    @linclark
    Contributor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions