The issue at hand seems to be peculiar to Chrome and Firefox, as IE does not exhibit the same behavior.
In my angular application, I've noticed a strange phenomenon. Once a specific view is loaded, all XHR requests made using relative paths are automatically converted into requests with absolute paths.
For instance:
If I navigate to http://example.com/foo/#/bar
and execute the following code in Chrome dev tools:
var xhr = new XMLHttpRequest();
xhr.open("GET", "ping", true);//or "./ping"
xhr.send();
The outcome is a 404 error, indicating that the request was actually sent to http://example.com/ping
instead of http://example.com/foo/ping
.
What could be causing this unexpected behavior?