question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The HttpClient prefixes absolute URLs with the value of the base attribute

See original GitHub issue

This SO post has the description:

https://stackoverflow.com/questions/59605333/not-using-the-base-attribute-when-making-domsanitizer-api-calls/59605790#59605790

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:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tiepptcommented, Jan 6, 2020

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:

image

0reactions
angular-automatic-lock-bot[bot]commented, Feb 8, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found