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

angular-resource breaks IPv6 URLs #12512

Closed
c2franz opened this issue Aug 6, 2015 · 1 comment
Closed

angular-resource breaks IPv6 URLs #12512

c2franz opened this issue Aug 6, 2015 · 1 comment

Comments

@c2franz
Copy link

c2franz commented Aug 6, 2015

There is a regular expression in angular-resource.js that is breaking IPv6 resource URLs:

url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
    leadingSlashes, tail) {
  if (tail.charAt(0) == '/') {
    return tail;
  } else {
    return leadingSlashes + tail;
  }
});

Example:
http://jsfiddle.net/c2franz/pszLs0kg/4/

Expected behavior: a GET request is performed to http://[2620:0:861:ed1a::1]
Observed behavior: a GET request is performed to http://[2620:0:861::1]

@lgalfaso
Copy link
Contributor

lgalfaso commented Aug 6, 2015

This looks like a real bug. PR welcome.

lgalfaso added a commit to lgalfaso/angular.js that referenced this issue Aug 9, 2015
Do not confuse IPv6 URLs domains and resource parameters.

Closes angular#12512
lgalfaso added a commit to lgalfaso/angular.js that referenced this issue Aug 9, 2015
Do not confuse IPv6 URLs domains and resource parameters.

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

No branches or pull requests

2 participants