< Summary - Jellyfin

Information
Class: Jellyfin.Api.Middleware.QueryStringDecodingMiddleware
Assembly: Jellyfin.Api
File(s): /srv/git/jellyfin/Jellyfin.Api/Middleware/QueryStringDecodingMiddleware.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 38
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 1/23/2026 - 12:11:06 AM Line coverage: 100% (2/2) Total lines: 384/19/2026 - 12:14:27 AM Line coverage: 100% (7/7) Branch coverage: 100% (2/2) Total lines: 38 4/19/2026 - 12:14:27 AM Line coverage: 100% (7/7) Branch coverage: 100% (2/2) Total lines: 38

Coverage delta

Coverage delta 1 -1

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Invoke()100%22100%

File(s)

/srv/git/jellyfin/Jellyfin.Api/Middleware/QueryStringDecodingMiddleware.cs

#LineLine coverage
 1using System.Threading.Tasks;
 2using Microsoft.AspNetCore.Http;
 3using Microsoft.AspNetCore.Http.Features;
 4
 5namespace Jellyfin.Api.Middleware;
 6
 7/// <summary>
 8/// URL decodes the querystring before binding.
 9/// </summary>
 10public class QueryStringDecodingMiddleware
 11{
 12    private readonly RequestDelegate _next;
 13
 14    /// <summary>
 15    /// Initializes a new instance of the <see cref="QueryStringDecodingMiddleware"/> class.
 16    /// </summary>
 17    /// <param name="next">The next delegate in the pipeline.</param>
 18    public QueryStringDecodingMiddleware(RequestDelegate next)
 19    {
 2120        _next = next;
 2121    }
 22
 23    /// <summary>
 24    /// Executes the middleware action.
 25    /// </summary>
 26    /// <param name="httpContext">The current HTTP context.</param>
 27    /// <returns>The async task.</returns>
 28    public async Task Invoke(HttpContext httpContext)
 29    {
 16830        var feature = httpContext.Features.Get<IQueryFeature>();
 16831        if (feature is not null)
 32        {
 16833            httpContext.Features.Set<IQueryFeature>(new UrlDecodeQueryFeature(feature));
 34        }
 35
 16836        await _next(httpContext).ConfigureAwait(false);
 15837    }
 38}