Skip to content

Commit

Permalink
fix(serve): improve URL handling and fix linting issues (gatsbyjs#39010)
Browse files Browse the repository at this point in the history
- Replace single quotes with backticks for consistency
- Add explicit express.RequestHandler return type
- Fix prettier formatting for template literals
- Improve code formatting and readability
  • Loading branch information
emmron committed Nov 7, 2024
1 parent 3bdc114 commit f5940fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby/src/commands/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const sanitizeUrl = (url: string): string => {
try {
// Decode URL and normalize slashes
const decoded = decodeURIComponent(url)
return decoded.replace(/\/+/g, '/').replace(/\/$/, '') || '/'
return decoded.replace(/\/+/g, `/`).replace(/\/$/, ``) || `/`
} catch (e) {
report.warn(`Failed to decode URL: ${url}`)
return url
Expand Down

0 comments on commit f5940fc

Please sign in to comment.