drupflare/worker - v1.0.4
    Preparing search index...

    Function chooseTarget

    • Which lane answers this request.

      Only reads on the serving path are spread. A write goes straight to the primary rather than spending a hop to be refused; the failover path is for a request that turns out to mutate.

      Parameters

      • input: {
            affinity: string;
            contentType?: string;
            hasSession?: boolean;
            method: string;
            pathname?: string;
            replicas: number;
            site: string;
            visitorPath?: string;
            writeForward?: boolean;
        }
        • affinity: string
        • OptionalcontentType?: string
        • OptionalhasSession?: boolean

          Whether the request already carries a session.

          A write with no session may establish one, and a lane cannot: its Set-Cookie is minted in the speculative run, so the client holds a session id the primary lacks (login looks like a rejected password). Pinning on this covers login, registration and reset without route names.

        • method: string
        • Optionalpathname?: string

          the front worker's own pathname, already rewritten; absent pins to the primary

        • replicas: number
        • site: string
        • OptionalvisitorPath?: string

          the visitor's own path (pathname is /serve after the rewrite)

        • OptionalwriteForward?: boolean

          whether a lane may execute a write and forward it; off pins every POST to the primary

      Returns RoutingDecision