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

Skip to main content Skip to navigation

BaseUrlCssResponseProcessor Pennington.Infrastructure

Prefixes root-relative url(...) references in CSS responses with the configured base URL, mirroring BaseUrlHtmlRewriter for stylesheets. Without this, hand-authored @font-face rules and other asset references fed through MonorailCssOptions.ExtraStyles resolve against the deployment root and 404 under sub-path deployments.

Properties

Order int
Execution order; lower values run earlier in the response pipeline.

Constructors

.ctor

#
public BaseUrlCssResponseProcessor(OutputOptions? outputOptions);

Initializes the processor with the base URL from OutputOptions.

Parameters

outputOptions OutputOptions?

Methods

ProcessAsync

#
public Task<string> ProcessAsync(string responseBody, HttpContext context);

Transforms responseBody and returns the processed body.

Parameters

responseBody string
context HttpContext

Returns

Task<string>

ShouldProcess

#
public bool ShouldProcess(HttpContext context);

Returns true when this processor should run for the current request.

Parameters

context HttpContext

Returns

bool

Pennington.Infrastructure.BaseUrlCssResponseProcessor

namespace Pennington.Infrastructure;

/// Prefixes root-relative url(...) references in CSS responses with the configured base URL, mirroring BaseUrlHtmlRewriter for stylesheets. Without this, hand-authored @font-face rules and other asset references fed through MonorailCssOptions.ExtraStyles resolve against the deployment root and 404 under sub-path deployments.
public class BaseUrlCssResponseProcessor
{
    /// Initializes the processor with the base URL from OutputOptions.
    
public BaseUrlCssResponseProcessor(OutputOptions? outputOptions);
/// Execution order; lower values run earlier in the response pipeline.
public int Order => 10;
/// Transforms responseBody and returns the processed body.
public Task<string> ProcessAsync(string responseBody, HttpContext context);
/// Returns true when this processor should run for the current request.
public bool ShouldProcess(HttpContext context);
}