File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/server/plugins/engine Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,18 @@ describe('Helpers', () => {
228228 expect ( h . redirect ) . not . toHaveBeenCalledWith ( request . query . returnUrl )
229229 }
230230 )
231+
232+ it ( 'should not forward custom query params to the next page URL' , ( ) => {
233+ request = {
234+ ...request ,
235+ method : 'post' ,
236+ query : { parcelId : 'SD5848-9205' }
237+ }
238+
239+ proceed ( request , h , '/test/next-page' )
240+
241+ expect ( h . redirect ) . toHaveBeenCalledWith ( '/test/next-page' )
242+ } )
231243 } )
232244
233245 describe ( 'encodeUrl' , ( ) => {
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import {
2222} from '~/src/server/plugins/engine/components/helpers/components.js'
2323import { type FormModel } from '~/src/server/plugins/engine/models/FormModel.js'
2424import { type PageControllerClass } from '~/src/server/plugins/engine/pageControllers/helpers/pages.js'
25- import { stripParam } from '~/src/server/plugins/engine/pageControllers/helpers/state.js'
2625import {
2726 type AnyFormRequest ,
2827 type FormContext ,
@@ -134,7 +133,7 @@ export function proceed(
134133 const response =
135134 isReturnAllowed && isPathRelative ( returnUrl )
136135 ? h . redirect ( returnUrl )
137- : h . redirect ( redirectPath ( nextUrl , stripParam ( query , 'returnUrl' ) ) )
136+ : h . redirect ( redirectPath ( nextUrl ) )
138137
139138 // Redirect POST to GET to avoid resubmission
140139 return method === 'post'
You can’t perform that action at this time.
0 commit comments