Files
7744cc91be fix: handle multiple x-forwarded-proto headers (#58824)
### What?
This PR changes how protocol is determined.
A change was recently made (in [PR
57815](https://github.com/vercel/next.js/commit/1caa58087a428666bb14d40dbc159b9a768b075d#diff-c49c4767e6ed8627e6e1b8f96b141ee13246153f5e9142e1da03450c8e81e96fR1744))
that did not take into account cases where there are multiple
`x-forwarded-proto` headers. In such cases, the protocol becomes e.g
"https, https".

### Why?
An error will occur in parseUrl on line 1616, since its not a valid url
(e.g. `https, https://localhost:3000`).

### How?
Reverted part of the changes in [PR
57815](https://github.com/vercel/next.js/pull/57815).

Fixes #58764 and fixes #59031

Closes NEXT-2437

---------

Co-authored-by: Balázs Orbán <[email protected]>
2024-02-14 14:47:26 +01:00
..
…