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.

Consider base URL when deciding if a URL is allowed by 'self' URL policy #15144

Closed
@adob

Description

@adob

Angular SCE currently rejects perfectly valid relative URLs in some situations when a tag is used. For example, if the page contains <base href="http://www.example.com">, Angular will start to reject relative URLs like 'foo.template.html'. Full example at https://plnkr.co/edit/3sFwq1d2d7wiWVBx4OHn

The root cause is that the urlIsSameOrigin() function in urlUtils.js matches against location.href instead of, or in addition to, document.baseURI.

Angular should permit URLs if protocol/host/port matches the base URL being used.

Affects AngularJS v1.5.8.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions