Skip to content

fix: ignore malformed uris in tranform middleware#19853

Merged
hi-ogawa merged 5 commits into
vitejs:mainfrom
itschasa:main
Apr 24, 2025
Merged

fix: ignore malformed uris in tranform middleware#19853
hi-ogawa merged 5 commits into
vitejs:mainfrom
itschasa:main

Conversation

@itschasa

@itschasa itschasa commented Apr 12, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes #19848

(might want to squash these commits lol)

Comment thread packages/vite/src/node/server/middlewares/transform.ts
@sapphi-red sapphi-red added the p2-edge-case Bug, but has workaround or limited in scope (priority) label Apr 14, 2025
@sapphi-red sapphi-red changed the title fix: malformed uri causing error fix: ignore malformed uris in tranform middleware Apr 15, 2025
@sapphi-red sapphi-red added the feat: dev dev server label Apr 15, 2025
@sapphi-red sapphi-red requested a review from hi-ogawa April 24, 2025 02:33

@hi-ogawa hi-ogawa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what else error can happen in the little snippet, but catching it makes sense to me 👍

(Also linking Vitest issue vitest-dev/vitest#7788 since we just recently discussed we need a similar decodeURI somewhere for Vitest browser mode)

@hi-ogawa hi-ogawa merged commit e4d5201 into vitejs:main Apr 24, 2025
@itschasa

Copy link
Copy Markdown
Contributor Author

I wonder what else error can happen in the little snippet, but catching it makes sense to me 👍

Most things happening in that try block are .replace(), so not much else can error from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: dev dev server p2-edge-case Bug, but has workaround or limited in scope (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URI malformed when receiving traffic from bittorrent clients

3 participants