Skip to content

Options object ignored, when getting "404.html" #56

Description

@d4h0

If DEBUG is set to false, the request that fetches the 404 page doesn' honor the options that are set above.

I have changed the following:

        let notFoundResponse = await getAssetFromKV(event, {
          mapRequestToAsset: req => new Request(`${new URL(req.url).origin}/404.html`, req),
        })

...to this:

        options.mapRequestToAsset = req =>
          new Request(`${new URL(req.url).origin}/404.html`, req)
        let notFoundResponse = await getAssetFromKV(event, options)

...which fixed the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions