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
Qivik6mo 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
Qivik6mo 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
Qivik6mo ago
No description
Qivik
Qivik6mo ago
Oh, yeah, my fault, ty
Hello, I’m Allie!
All good!
Qivik
Qivik6mo ago
Still have in /api functions old header 'Authorization'
Qivik
Qivik6mo ago
solved
No description
Qivik
Qivik6mo ago
Also ty for good advice!