Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions .changeset/tidy-peas-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

fix preview server pathname parse
3 changes: 2 additions & 1 deletion packages/astro/src/core/preview/vite-plugin-astro-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export function vitePluginAstroPreview(settings: AstroSettings): Plugin {
return;
}

const pathname = stripBase(req.url!, base);
let strippedPathname = stripBase(req.url!, base);
const pathname = new URL(strippedPathname, 'https://test.com').pathname
const isRoot = pathname === '/';

// Validate trailingSlash
Expand Down