• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Aldaviva / Unfucked / 39086174486

15 Oct 2026 06:11PM UTC coverage: 42.05% (-0.5%) from 42.526%
39086174486

push

github

Aldaviva
Added HTML parser integration in Unfucked.HTTP with AngleSharp, if it's installed (provided dependency). This changed the signature of the MessagBodyReader interface's Read method, affecting all external implementations. Add a convenience constructor to the console progress bar options struct. Renamed datablow block that aggregates all inputs into one output list from JoinAllBlock to CollectBlock, because join is often used in .NET to refer to a database join (what underscore refers to as zip).

710 of 2175 branches covered (32.64%)

22 of 75 new or added lines in 10 files covered. (29.33%)

130 existing lines in 6 files now uncovered.

1243 of 2956 relevant lines covered (42.05%)

160.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/HTTP/Serialization/HtmlDocumentReader.cs
1
using AngleSharp;
2
using AngleSharp.Dom;
3
using System.Text;
4
using Unfucked.HTTP.Config;
5

6
namespace Unfucked.HTTP.Serialization;
7

8
public sealed class HtmlDocumentReader: MessageBodyReader, IDisposable {
9

NEW
10
    private readonly Lazy<IBrowsingContext> browser = new(() => BrowsingContext.New(Configuration.Default), LazyThreadSafetyMode.PublicationOnly);
×
11

NEW
12
    public bool CanRead<T>(string? mimeType, string? bodyPrefix) => typeof(T) == typeof(IDocument);
×
13

14
    public async Task<T> Read<T>(HttpResponseMessage response, Encoding? responseEncoding, Configurable? clientConfig, CancellationToken cancellationToken) {
15
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER
16
        await using
17
#else
NEW
18
        using
×
NEW
19
#endif
×
NEW
20
            Stream responseStream = await response.Content
×
NEW
21
#if NET5_0_OR_GREATER
×
NEW
22
                .ReadAsStreamAsync(cancellationToken)
×
NEW
23
#else
×
NEW
24
                .ReadAsStreamAsync()
×
NEW
25
#endif
×
NEW
26
                .ConfigureAwait(false);
×
27

NEW
28
        return (T) await browser.Value.OpenAsync(virtualResponse => {
×
NEW
29
            if (response.RequestMessage?.RequestUri is {} uri) {
×
NEW
30
                virtualResponse.Address(uri);
×
NEW
31
            }
×
NEW
32

×
NEW
33
            virtualResponse
×
NEW
34
                .Status(response.StatusCode)
×
NEW
35
                .Headers(response.Headers.Concat(response.Content.Headers).ToDictionary(pair => pair.Key, pair => pair.Value.Join(", ")))
×
NEW
36
                .Content(responseStream);
×
NEW
37
        }, cancellationToken).ConfigureAwait(false);
×
NEW
38
    }
×
39

40
    /// <inheritdoc />
NEW
41
    public void Dispose() => browser.TryDisposeValue();
×
42

43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc