Skip to content

Releases: m4bwav/IsImageUrlDotNet

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 27 Sep 21:15
9e51d05

Compatibility promise. IsImageUrlDotNetLib.IsImageUrl and the lists ImageFileExtensions and NonImageFileExtensions give 1.0.2's answers, with the same requests, on each runtime a caller can have. The check covers every case recorded from the published 1.0.2 on .NET Framework 4.8 (Windows) and on .NET 10 (Windows, Linux and macOS), 117 cases per runtime in tests/Golden/. There are no exceptions. The namespace, module, parameter name opt and the C# extension form url.IsImageUrl() stay as they were. Every fix is under a new name, in the new ImageUrl type.

Added

  • ImageUrl.HasImageExtension(url): an offline check of the extension of the URL's path (query and fragment ignored), ordinal and case-insensitive, with the same answer on every OS; it never throws and never reads local files.
  • ImageUrl.IsImageUrlAsync(url), with overloads taking an HttpClient and a CancellationToken: http and https only; a GET that reads only the headers; true for a 2xx answer with an image/* media type; false for anything else the server answers; up to 10 redirects followed, http and https only and never from https to http; HttpRequestException and TaskCanceledException when it cannot ask. The shared client times out after 10 seconds and sends a User-Agent naming the package.
  • ImageUrl.ImageExtensions: 1.0.2's eight image extensions plus webp, avif, apng, ico, tif, tiff, heic and heif.
  • Both new methods are C# extension methods too: url.HasImageExtension(), await url.IsImageUrlAsync().
  • net10.0, net462 and netstandard2.0 builds, Source Link, symbols (snupkg), XML documentation, a README and an icon in the package. The net462 build brings the System.Net.Http reference that .NET Framework projects need for ImageUrl's HttpClient overloads.

Changed

  • IsImageUrl is marked [Obsolete] (a warning). Its answers are unchanged.
  • The package declares its dependency on FSharp.Core (6.0.7 or later). 1.0.2 referenced FSharp.Core 4.4.0.0 without declaring it, so a C# project without FSharp.Core failed on first use.
  • Requires .NET Framework 4.6.2 or later, or .NET Core 2.0 or later (1.0.2 targeted .NET Framework 4.5). .NET Framework 4.5 to 4.6.1 have been out of Microsoft support since 2022, and FSharp.Core 5 and later have no net45 build.
  • Licence metadata is an SPDX expression (MIT); the package description no longer misspells the call.

Removed

  • The 2016 Visual Studio projects, the nuspec and the Travis configuration (it could never pass).
  • The old MSTest tests, which called google.com and other live sites. The golden, unit, public-API and C# tests replace them and never touch the network.

v2.0.0-beta.1

v2.0.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 27 Sep 20:57
06b4aa4

The release rehearsal of 2.0.0: the same code and package as described under 2.0.0 below, published as a prerelease to prove the release path (Trusted Publishing, the approval gate, verification from nuget.org).