mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
fix: Query params trigger the trailingSlash error in preview mode (#9045)
This commit is contained in:
parent
b895113a0a
commit
84312f24f8
2 changed files with 7 additions and 1 deletions
5
.changeset/tidy-peas-accept.md
Normal file
5
.changeset/tidy-peas-accept.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes preview server `trailingSlash` handling for request URLs with query strings
|
|
@ -24,7 +24,8 @@ export function vitePluginAstroPreview(settings: AstroSettings): Plugin {
|
|||
return;
|
||||
}
|
||||
|
||||
const pathname = stripBase(req.url!, base);
|
||||
const strippedPathname = stripBase(req.url!, base);
|
||||
const pathname = new URL(strippedPathname, 'https://a.b').pathname
|
||||
const isRoot = pathname === '/';
|
||||
|
||||
// Validate trailingSlash
|
||||
|
|
Loading…
Add table
Reference in a new issue