Feature request: context for rewriteRequestPath function
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'))
}),
);
Hi @vanodevium
This is a good idea. Someone or I can work on it. Thank you.
@yusukebe I could make this change myself, but I'm not good at typescript at all.
However, I really need this feature as soon as possible.
@yusukebe Sorry to bother you. Any updates for this?
@yusukebe Thank you!
@vanodevium
I forgot it completely. Sorry! I've released the latest version, 1.15.0. Can you try it?
@yusukebe Already in progress. I'll write feedback.
@yusukebe Works like a charm. Thanx again!