Skip to content
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
@klhuillier

Description

@klhuillier
// 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions