1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

only take up to 40 links

This commit is contained in:
Kyle Spearrin 2018-05-31 22:04:01 -04:00
parent 850000ab26
commit a6260c867c

View File

@ -94,7 +94,7 @@ namespace Bit.Icons.Services
var links = doc.DocumentNode.SelectNodes(@"//head/link[@href]");
if(links != null)
{
foreach(var link in links)
foreach(var link in links.Take(40))
{
var hrefAttr = link.Attributes["href"];
if(string.IsNullOrWhiteSpace(hrefAttr?.Value))
@ -130,11 +130,11 @@ namespace Bit.Icons.Services
{
iconUri = new Uri($"{uri.Scheme}://{icon.Path.Substring(2)}");
}
else if(Uri.TryCreate(icon.Path, UriKind.Relative, out Uri relUri))
else if(Uri.TryCreate(icon.Path, UriKind.Relative, out var relUri))
{
iconUri = ResolveUri($"{uri.Scheme}://{uri.Host}", baseUrl, relUri.OriginalString);
}
else if(Uri.TryCreate(icon.Path, UriKind.Absolute, out Uri absUri))
else if(Uri.TryCreate(icon.Path, UriKind.Absolute, out var absUri))
{
iconUri = absUri;
}