mirror of
https://github.com/bitwarden/server.git
synced 2025-04-21 21:15:10 -05:00
blacklist of link rels to ignore
This commit is contained in:
parent
dee395960a
commit
594c9e9e3e
@ -17,6 +17,8 @@ namespace Bit.Icons.Services
|
|||||||
{
|
{
|
||||||
private readonly HashSet<string> _iconRels =
|
private readonly HashSet<string> _iconRels =
|
||||||
new HashSet<string> { "icon", "apple-touch-icon", "shortcut icon" };
|
new HashSet<string> { "icon", "apple-touch-icon", "shortcut icon" };
|
||||||
|
private readonly HashSet<string> _blacklistedRels =
|
||||||
|
new HashSet<string> { "preload", "image_src", "preconnect", "canonical", "alternate", "stylesheet" };
|
||||||
private readonly HashSet<string> _iconExtensions =
|
private readonly HashSet<string> _iconExtensions =
|
||||||
new HashSet<string> { ".ico", ".png", ".jpg", ".jpeg" };
|
new HashSet<string> { ".ico", ".png", ".jpg", ".jpeg" };
|
||||||
|
|
||||||
@ -155,7 +157,7 @@ namespace Bit.Icons.Services
|
|||||||
{
|
{
|
||||||
icons.Add(new IconResult(hrefAttr.Value, sizesAttr?.Value));
|
icons.Add(new IconResult(hrefAttr.Value, sizesAttr?.Value));
|
||||||
}
|
}
|
||||||
else
|
else if(relAttr == null || !_blacklistedRels.Contains(relAttr.Value.ToLower()))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user