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

$resource does not obey port numbers in URLs #1664

Closed
jsyrjala opened this issue Dec 6, 2012 · 2 comments
Closed

$resource does not obey port numbers in URLs #1664

jsyrjala opened this issue Dec 6, 2012 · 2 comments

Comments

@jsyrjala
Copy link
Contributor

jsyrjala commented Dec 6, 2012

Following code fails because browser makes query to http://198.61.201.6/api/v1-dev/trackers, using standard http port 80, completely ignoring specified port.

I tested this on versions 1.0.2, 1.0.3, 1.1.0 and 1.1.1, same behavior in every case.

   var Tracker = $resource('http://198.61.201.6:8000/api/v1-dev/trackers');

    $scope.fetchTrackers = function() {
        this.trackers = Tracker.get();
    };
@jtymes
Copy link
Contributor

jtymes commented Dec 6, 2012

See #1243 and #942 and please do a quick search before posting to make sure that this hasn't already been reported. Thanks!

@pkozlowski-opensource
Copy link
Member

@jsyrjala $resource uses the colon (:) as a params delimiter so it needs to be escaped. You can do it by writing:
http://198.61.201.6\\:8000/api/v1-dev/trackers. Here is the jsFiddle: http://jsfiddle.net/mkLzh/

Closing for now, a PR with the documentation update would be awesome.

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

No branches or pull requests

3 participants