A Comunica actor to intercept HTTP requests to recover broken links using the WayBack Machine

Hierarchy (View Summary)

Constructors

Properties

beforeActors: Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>[] = []

Actor that must be registered in the bus before this actor.

bus: Bus<
    Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>,
    IActionHttp,
    IActorTest,
    IActorHttpOutput,
    undefined,
>

The bus this actor subscribes to.

mediatorHttp: MediatorHttp
name: string

The name for this actor.

{<rdf:subject>}

Methods

  • Creates an appropriate User-Agent header string for Node.js or other environments. Within browsers, returns undefined, because the value should not be overridden due to potential CORS issues.

    Parameters

    • actorName: string
    • actorVersion: string

    Returns undefined | string

  • Extract the requested URL from the action input.

    Parameters

    • input: RequestInfo | URL

      The request input.

    Returns URL

    The extracted URL.

  • Convert the given headers object into a raw hash.

    Parameters

    • headers: Headers

      A headers object.

    Returns Record<string, string>

  • Attempts to determine whether the current environment is a browser or not.

    Returns boolean

    True for browsers and web workers, false for other runtimes.

  • Converts WhatWG streams to Node streams if required. Returns the input in case the stream already is a Node stream.

    Parameters

    • body: null | ReadableStream<any>

    Returns ReadableStream

    A node stream.