Skip to content

Commit

Permalink
use x-inertia-frame header
Browse files Browse the repository at this point in the history
  • Loading branch information
buhrmi committed Apr 4, 2024
1 parent 16aaf0a commit 2d2f50d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,10 @@ export class Router {

const pageResponse: Page = response.data

// we can overwrite the target frame in the controller by setting a flash
if (response.data.props.flash && response.data.props.flash.target_frame) target = response.data.props.flash.target_frame
// if an X-Inertia-Frame header is present, use its value to override target frame id
if (response.headers['x-inertia-frame']) {
target = response.headers['x-inertia-frame']
}

if (only.length && pageResponse.component === this.page.component) {
pageResponse.props = { ...this.page.props, ...pageResponse.props }
Expand Down

0 comments on commit 2d2f50d

Please sign in to comment.