Skip to content

Commit

Permalink
Cleanup and SDK update (#117)
Browse files Browse the repository at this point in the history
* Cleanup and SDK update

* Bump setup dotnet action version

* Remove errant space
  • Loading branch information
Turnerj authored Apr 29, 2024
1 parent 1f1e72e commit 4ac4cdb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup dotnet 3.1 5.0 6.0
uses: actions/setup-dotnet@v1
- name: Setup dotnet SDKs
uses: actions/setup-dotnet@v1.9.0
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down Expand Up @@ -63,7 +62,7 @@ jobs:
- name: Prepare coverage reports
run: reportgenerator -reports:*/coverage/*/coverage.cobertura.xml -targetdir:./ -reporttypes:Cobertura
- name: Upload coverage report
uses: codecov/codecov-action@v1.0.13
uses: codecov/codecov-action@v4.3.0
with:
file: Cobertura.xml
fail_ci_if_error: false
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

A sitemap (sitemap.xml) querying and parsing library for .NET

![Build](https://img.shields.io/github/workflow/status/TurnerSoftware/sitemaptools/Build)
![Build](https://img.shields.io/github/actions/workflow/status/TurnerSoftware/sitemaptools/build.yml?branch=main)
[![Codecov](https://img.shields.io/codecov/c/github/turnersoftware/sitemaptools/master.svg)](https://codecov.io/gh/TurnerSoftware/SitemapTools)
[![NuGet](https://img.shields.io/nuget/v/TurnerSoftware.SitemapTools.svg)](https://www.nuget.org/packages/TurnerSoftware.SitemapTools)
</div>
Expand Down
9 changes: 6 additions & 3 deletions src/TurnerSoftware.SitemapTools/SitemapQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ public async Task<IEnumerable<Uri>> DiscoverSitemapsAsync(string domainName, Can

return result;
}


private static bool IsCompressedStream(string contentType) =>
contentType.Equals("application/x-gzip", StringComparison.InvariantCultureIgnoreCase) ||
contentType.Equals("application/octet-stream", StringComparison.InvariantCultureIgnoreCase);

/// <summary>
/// Retrieves a sitemap at the given URI, converting it to a <see cref="SitemapFile"/>.
/// </summary>
Expand All @@ -147,8 +151,7 @@ public async Task<IEnumerable<Uri>> DiscoverSitemapsAsync(string domainName, Can
var contentType = response.Content.Headers.ContentType.MediaType;
var requiresManualDecompression = false;

if (contentType.Equals("application/x-gzip", StringComparison.InvariantCultureIgnoreCase)||
contentType.Equals("application/octet-stream", StringComparison.InvariantCultureIgnoreCase))
if (IsCompressedStream(contentType))
{
requiresManualDecompression = true;
var baseFileName = Path.GetFileNameWithoutExtension(sitemapUrl.AbsolutePath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net6.0;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down

0 comments on commit 4ac4cdb

Please sign in to comment.