This PR strips the path from the URLs if a favicon URL is relative.
Say example.com has their favicon available at example.com/favicon.ico by specifying it in their HTML like so:
<link rel="icon" href="favicon.ico" />
Now let's say we use Favicon::driver('http')->fetch('https://example.com/blog'). Previously, this would have returned https://example.com/blog/favicon.ico because we were just concatenating the website URL and the favicon's relative path.
This PR will strip the path from the URL, so it will return https://example.com/favicon.ico instead 🙂
This PR strips the path from the URLs if a favicon URL is relative.
Say
example.com
has their favicon available atexample.com/favicon.ico
by specifying it in their HTML like so:Now let's say we use
Favicon::driver('http')->fetch('https://example.com/blog')
. Previously, this would have returnedhttps://example.com/blog/favicon.ico
because we were just concatenating the website URL and the favicon's relative path.This PR will strip the path from the URL, so it will return
https://example.com/favicon.ico
instead 🙂