Middleware rewrite internal request URL re-serializes incorrectly causing query param value with & to split
When a middleware rewrites a request and sets a query parameter whose value contains a literal '&', the internal request generated by Next.js re-serializes the URL using URLSearchParams.toString(), which decodes and re-encodes the value, causing the '&' to be treated as a query string separator. This results in the value being truncated and the secret parameter leaking to the top-level, breaking the rewrite flow.
