This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Inconsistent handling of $sce trustedUrl with $http #11328
Closed
Description
// Works:
$http.get($sce.trustAsUrl('/')).success(function(d){$log.log(d);});
// Fails:
$http.get($sce.trustAsUrl('/'), {params: {timestamp: 0}}).success(function(d){$log.log(d);});
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.