next.js icon indicating copy to clipboard operation
next.js copied to clipboard

fix: fixes cookie override during redirection from server action

Open technikhil314 opened this issue 1 year ago • 0 comments

What?

Fixes #61611

Why?

Any one having custom server may be having logic to set cookies during GET requests too. Currently nextjs in app directory does not allow to do so but with custom server its very much possible.

How?

By merging cookies of redirect response and server action POSt response

Tests

I have added one more test to existing suite and it passing with fix in place. image

Notes

This bug is reproducible only if developer has custom server on top of next app but still very probable

technikhil314 avatar Feb 04 '24 17:02 technikhil314