-
Notifications
You must be signed in to change notification settings - Fork 27.4k
port number swallowed by Route(template, defaults), yielding 12029 from IE9 #942
Comments
There are several things going on here:
|
Please switch to curly-wrapped url variables because they're clearer, curlies are rarely used in urls, a start/end pair of curlies can unambiguously denote a name including special chars, and because colon-prefixed is just strange in a URL that may contain colons for port numbers. |
Wow! This problem has wasted several hours of my time. Yes, when using resources, you must escape the colon for the port number in your URL. You may have to double-escape it, e.g. "http://foo.com\\:8080/blah". Thanks for the tip! |
Just had this same problem had to double escape like above user e.g. "http://localhost\\:9292/phones" |
Strings literals always have to have backslash escaping rules applied. angular.js does not make any special exception here. To put a literal backslash character into a string, one must always escape it with a backslash, e.g. "\". |
There is a also a disparity between how $resource and $http handle this. For example, if you use a common config variable with the double port (
|
Im using angular 1.0.4 and are getting a similar issue (swallowed port). @IgorMinar, in response to having absolute urls, it makes sense in my situation. Im deploying an angular application to phonegap. I need to specify the full url for the resources to work properly. |
I finally tracked down why my AJAX service wasn't working. The debuggers in IE9 and Firefox kept saying that my request had been aborted. At least IE9 showed an xhr.status of 12029, giving a nebulous indication that something was wrong with the network.
While debugging through the code, I noticed that my HTTP port number (which follows the server, separated by a colon) was getting removed from my URL (http://localhost:88/...).
I tracked it to function Route(template, defaults) and its search for URL parameters via regular expression. Apparently, 88 also gets encoded to an empty string (or some non-printable character?).
In case anyone else runs into this and needs a workaround, I was simply able to drop the prefix from my URL and allow the relative URL mechanism to take over. For example, http://localhost:88/a/b/c --> /a/b/c.
The text was updated successfully, but these errors were encountered: