Class RedirectingHttpHandler

Handler that redirects paths matching given patterns to their corresponding URL, substituting selected groups.

Hierarchy

Constructors

Properties

baseUrl: string
logger: Logger = ...
redirects: {
    redirectPattern: string;
    regex: RegExp;
}[]
responseWriter: ResponseWriter

To write the redirect to the response.

statusCode: 302 | 301 | 308 | 303 | 307 = 308

Desired 30x redirection code (defaults to 308).

targetExtractor: TargetExtractor

To extract the target from the request.

Methods

  • Checks if the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.

    Parameters

    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.