This site provides a machine-readable index at /llms.txt.

Skip to main content Skip to navigation

PenningtonRedirectMiddleware Pennington.Infrastructure

Issues HTTP 301 responses for URLs in RedirectContentService's merged redirect map (_redirects.yml + per-page redirectUrl: front matter). Runs before content routing so dev requests redirect cleanly; the static build crawler captures the same 301 response and OutputGenerationService writes the meta-refresh body to disk. One code path for dev and publish.

Constructors

.ctor

#
public PenningtonRedirectMiddleware(RequestDelegate next);

Initializes the middleware with the next delegate in the pipeline.

Parameters

next RequestDelegate

Methods

InvokeAsync

#
public async Task InvokeAsync(HttpContext context, RedirectContentService redirects);

Issues a 301 when the request path matches the merged redirect map, otherwise calls the next delegate.

Parameters

context HttpContext
redirects RedirectContentService

Returns

Task

Pennington.Infrastructure.PenningtonRedirectMiddleware

namespace Pennington.Infrastructure;

/// Issues HTTP 301 responses for URLs in RedirectContentService's merged redirect map (_redirects.yml + per-page redirectUrl: front matter). Runs before content routing so dev requests redirect cleanly; the static build crawler captures the same 301 response and OutputGenerationService writes the meta-refresh body to disk. One code path for dev and publish.
public class PenningtonRedirectMiddleware
{
    /// Initializes the middleware with the next delegate in the pipeline.
    
public PenningtonRedirectMiddleware(RequestDelegate next);
/// Issues a 301 when the request path matches the merged redirect map, otherwise calls the next delegate.
public async Task InvokeAsync(HttpContext context, RedirectContentService redirects);
}