Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/server/plugins/engine/components/PaymentField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ export class PaymentField extends FormComponent {
: 'Add a valid test API key before you can preview the payment journey.'
const govukError = createError(componentName, message)
request.yar.flash(COMPONENT_STATE_ERROR, govukError, true)
return h.redirect(request.url.href).code(StatusCodes.SEE_OTHER)
return h
.redirect(`${request.url.pathname}${request.url.search}`)
.code(StatusCodes.SEE_OTHER)
}

const sessionData: PaymentSessionData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export class QuestionPageController extends PageController {
// Copy any URL params into the form state (if not already done so)
if (await prefillStateFromQueryParameters(request, this)) {
// Forward to same page without query string
return h.redirect(`${request.url.origin}${request.url.pathname}`)
return h.redirect(request.url.pathname)
}

const viewModel = this.getViewModel(request, context)
Expand Down Expand Up @@ -625,7 +625,7 @@ export class QuestionPageController extends PageController {
return await selectedComponent.dispatcher(request, h, {
component,
controller: this,
sourceUrl: request.url.toString(),
sourceUrl: `${request.url.pathname}${request.url.search}`,
actionArgs: args,
isLive,
isPreview
Expand Down
Loading