File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/open-next/src/core/routing Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -98,12 +98,15 @@ export function convertRes(res: OpenNextNodeResponse): InternalResult {
9898 * @__PURE__
9999 */
100100export function convertToQueryString ( query : Record < string , string | string [ ] > ) {
101+ // URLSearchParams is a a representation of the PARSED query.
102+ // So we must decode the value before appending it to the URLSearchParams.
103+ // https://stackoverflow.com/a/45516812
101104 const urlQuery = new URLSearchParams ( ) ;
102105 Object . entries ( query ) . forEach ( ( [ key , value ] ) => {
103106 if ( Array . isArray ( value ) ) {
104- value . forEach ( ( entry ) => urlQuery . append ( key , entry ) ) ;
107+ value . forEach ( ( entry ) => urlQuery . append ( key , decodeURIComponent ( entry ) ) ) ;
105108 } else {
106- urlQuery . append ( key , value ) ;
109+ urlQuery . append ( key , decodeURIComponent ( value ) ) ;
107110 }
108111 } ) ;
109112 const queryString = urlQuery . toString ( ) ;
You can’t perform that action at this time.
0 commit comments