Skip to content

fix(material/icon): keep FuncIRI references on current origin - #33812

Open
moamenmahmod wants to merge 1 commit into
angular:mainfrom
moamenmahmod:fix/mat-icon-protocol-relative-funciri
Open

moamenmahmod wants to merge 1 commit into
angular:mainfrom
moamenmahmod:fix/mat-icon-protocol-relative-funciri

Conversation

@moamenmahmod

Copy link
Copy Markdown

Summary

  • keep MatIcon FuncIRI rewrites on the current origin when the page path starts with //
  • preserve the exact multi-slash current-document path by making it explicitly root-relative with a
    dot segment
  • add a regression test covering multiple leading slashes, a path, and a query string

Background

MatIcon._prependPathToReferences() prepends the current pathname and search string to SVG
same-document references. A pathname beginning with // is otherwise parsed as a protocol-relative
URL, which can turn url(#id) into a cross-origin request.

Google's OSS VRP referred this report to the Angular maintainers as issue 548479960.
The local-only browser reproduction and evidence are available at
https://github.com/moamenmahmod/angular-material-funciri-poc.

Fixes #33811

Testing

  • pnpm test src/material/icon --no-watch
  • pnpm lint

@google-cla

google-cla Bot commented Sep 15, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Paths beginning with two slashes were interpreted as protocol-relative URLs when MatIcon rewrote same-document SVG references. Prefix those paths with a dot segment so they resolve on the current origin while retaining the current document path.
@moamenmahmod
moamenmahmod force-pushed the fix/mat-icon-protocol-relative-funciri branch from ed1f16c to 9860d5f Compare September 15, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(material/icon): keep FuncIRI references same-origin on multi-slash paths

1 participant