pages functions middleware help

I have issue with middleware, i need to change in middleware authorization header from response, to use it in next requests in /api folder, but it doesnt changing.
No description
11 Replies
Hello, I’m Allie!
You can't use Pages Middleware with Next.js if that is what you mean
Qivik
QivikOP12mo ago
I dont using next.js I mean that i use middleware to change authorization header before it will proceed in /api folder (functions), but authorization header doesnt change
Hello, I’m Allie!
Just checking, are you calling next before changing the Authorization header?
Qivik
QivikOP12mo ago
Yep Is that root of issue?
Hello, I’m Allie!
Yeah. Once you call next, then it consumes the Request. After that, you can modify it, but you have already used the old one Modify the Request Headers, then call next()
Qivik
QivikOP12mo ago
No description
Qivik
QivikOP12mo ago
Oh, yeah, my fault, ty
Hello, I’m Allie!
All good!
Qivik
QivikOP12mo ago
Still have in /api functions old header 'Authorization'
Qivik
QivikOP12mo ago
solved
No description
Qivik
QivikOP12mo ago
Also ty for good advice!
Want results from more Discord servers?
Add your server