Skip to content

fix: When alias contains parameters, append ext error #1855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 10, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
fix: improve regex formatting in getFileName method
  • Loading branch information
sy-records committed Apr 9, 2025
commit cc21f4d996862eaf25a3e70e66a731c9941412dc
6 changes: 3 additions & 3 deletions src/core/router/history/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export class History {
#getFileName(path, ext) {
const [basePath, query] = path.split('?');

const hasValidExt = new RegExp(
`\\.(${ext.replace(/^\./, '')}|html)$`
).test(basePath);
const hasValidExt = new RegExp(`\\.(${ext.replace(/^\./, '')}|html)$`).test(
basePath,
);

const updatedPath = hasValidExt
? basePath
Expand Down