Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 163e18d

Browse filesBrowse files
committed
fix(nitro): use regexp to strip query
1 parent e9cddf4 commit 163e18d
Copy full SHA for 163e18d

1 file changed

+3-2Lines changed: 3 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/nitro-server/src/runtime/handlers
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/nitro-server/src/runtime/handlers/island.ts‎

Copy file name to clipboardExpand all lines: packages/nitro-server/src/runtime/handlers/island.ts
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ const VALID_COMPONENT_NAME_RE = /^[a-z][\w.-]*$/i
116116

117117
async function getIslandContext (event: H3Event): Promise<NuxtIslandContext> {
118118
let url = event.path || ''
119-
if (import.meta.prerender && event.path && await islandPropCache!.hasItem(event.path)) {
119+
const islandPath = url.replace(/\?.*$/, '')
120+
if (import.meta.prerender && event.path && await islandPropCache!.hasItem(islandPath)) {
120121
// for prerender, the original request URL (with query) is rehydrated from cache
121122
// so that re-renders of the same island path use the original props
122-
url = await islandPropCache!.getItem(withoutQuery(event.path)) as string
123+
url = await islandPropCache!.getItem(islandPath) as string
123124
}
124125

125126
if (!url.startsWith(ISLAND_PATH_PREFIX)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.