The HttpClient prefixes absolute URLs with the value of the base attribute
See original GitHub issueThis SO post has the description:
The summary is that even though we are making absolute URL requests like this:
this.matIconRegistry.addSvgIcon(
"fs",
this.domSanitizer.bypassSecurityTrustResourceUrl('https://github.com/fireflysemantics/images/blob/master/fsalpha/logo/fsalpha-logo-optimized.svg'));
Angular will still prefix the URL:
https://github.com/fireflysemantics/images/blob/master/fsalpha/logo/fsalpha-logo-optimized.svg'
With the URL in the base attribute.
The SO post contains links to a medium article and another Stackblitz that shows this happening in a live environment.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Not using the base attribute when making DomSanitizer API ...
This looks like a bug. There is no possible reason for the HttpClient to rewrite a URL which has a protocol. Material icon...
Read more >ASP.NET Core Blazor routing and navigation - Microsoft Learn
Learn how to manage request routing in Blazor apps and how to use the Navigation Manager and NavLink component for navigation.
Read more >HTTP Client - StreamSets Documentation
The HTTP Client processor sends requests to an HTTP resource URL and writes responses to records. For information about supported versions, see Supported ......
Read more >Routing (Symfony Docs)
PHP attributes allow to define routes next to the code of the controllers associated to those routes. Attributes are native in PHP 8...
Read more >2.6 URLs — HTML5 - W3C
If the algorithm was invoked with an absolute URL to use as the base URL, ... Otherwise, let url be the value of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I don’t see any bug here. The stackblitz is missing closing head tag. This one is working without bug:
https://stackblitz.com/edit/angular-material-custom-icon-with-base-zavkvw?file=src/index.html image:
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.