diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index bd1d588..2b20449 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -28,7 +28,7 @@ jobs: - name: dotnet - setup uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.x' + dotnet-version: '9.x' - name: dotnet - publish app run: | diff --git a/src/ES.ThreatFeed/ES.ThreatFeed.csproj b/src/ES.ThreatFeed/ES.ThreatFeed.csproj index 67515a1..29b2374 100644 --- a/src/ES.ThreatFeed/ES.ThreatFeed.csproj +++ b/src/ES.ThreatFeed/ES.ThreatFeed.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net9.0 enable enable @@ -22,17 +22,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/ES.ThreatFeed/Provider/DomainThreatFeedService.cs b/src/ES.ThreatFeed/Provider/DomainThreatFeedService.cs index b123614..0aab43b 100644 --- a/src/ES.ThreatFeed/Provider/DomainThreatFeedService.cs +++ b/src/ES.ThreatFeed/Provider/DomainThreatFeedService.cs @@ -95,9 +95,16 @@ IReadOnlyList ParseHostsFileFormat(string rawContent) if (!lineParts.Any()) continue; var entry = lineParts.Last().ToLowerInvariant().Trim(); - var uri = new Uri($"protocol://{entry}", UriKind.Absolute); - if (uri.IsLoopback) continue; - if (uri.HostNameType != UriHostNameType.Dns) continue; + try + { + var uri = new Uri($"protocol://{entry}", UriKind.Absolute); + if (uri.IsLoopback) continue; + if (uri.HostNameType != UriHostNameType.Dns) continue; + } + catch(Exception) + { + continue; + } var entryParts = entry.Split(".", StringSplitOptions.RemoveEmptyEntries);