Skip to content

Feature request: context for rewriteRequestPath function #227

@vanodevium

Description

@vanodevium

I have a very interesting case:
I need to change the folder where the files are actually located, depending on the cookies that the user has.

So I really miss the context object in this function as the second argument.

Could you add it, please.

Example: something like

app.use(
  "/*",
  serveStatic({
    root: "./public/",
    rewriteRequestPath: (path, ctx) => path.replace('...', getCookie(ctx, 'concrete'))
  }),
);

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