Inconsistent handling of $sce trustedUrl with $http #11328
In the first case, when the trusted URL reaches the XmlHttpRequest, its toString method is used to get the wrapped URL. In the second case, the buildUrl function attempts to add parameters, but the given URL is not a string as expected.
I feel that the buildUrl function should reject a non-string argument for url in all cases.
I thought about suggesting buildUrl tolerate trusted URLs, but I couldn't think of a reason it should. I also can't think of a reason it should not, other than, "is it really necessary?" I would be agreeable to either option.
The main issue was trusted URLs were working some of the time, but failing with an unhelpful message at other times. According to the current documentation, it should be failing every time because url is specified as type string.
referenced this issue
Apr 16, 2015
I have a work in progress PR that will fix this as a side effect of fixing #11352. I started on it yesterday but didn't have time to finish it. I won't get to it anytime today or tomorrow. However, I created a work-in-progress PR to let folks know that some work has started on it.