antlion-lacewing - v2.0.1
    Preparing search index...

    Function fromNodeRequest

    • Turn a Node request into what verifyDPoPRequest reads.

      Headers come from headersDistinct, because req.headers keeps only the first of two Authorization headers and a duplicate would go unseen. Only Authorization and DPoP are copied.

      The path is url if given, else Express's originalUrl, else req.url. Pass it when something in front of you rewrote req.url: under koa-mount, ctx.req.url has lost the mount prefix and only ctx.originalUrl still has the path the client signed.

      Parameters

      Returns DPoPRequest

      verifyDPoPRequest(fromNodeRequest(req), dpop);                    // node:http, Express
      verifyDPoPRequest(fromNodeRequest(request.raw), dpop); // Fastify
      verifyDPoPRequest(fromNodeRequest(ctx.req, ctx.originalUrl), dpop); // Koa