Skip to content

Do not pass data: fetch requests to the native http request handler#8347

Open
frederikbosch wants to merge 1 commit intoionic-team:mainfrom
frederikbosch:patch-2
Open

Do not pass data: fetch requests to the native http request handler#8347
frederikbosch wants to merge 1 commit intoionic-team:mainfrom
frederikbosch:patch-2

Conversation

@frederikbosch
Copy link

@frederikbosch frederikbosch commented Feb 15, 2026

For all sorts of reasons, a fetch request of data URI might be executed.

fetch(new URL('data:text/css,body{background:red}'))

At the moment these requests are forwarded to the native request, causing crashes like the one that PR #8304 is trying to solve. With this PR, data: requests will not be forwarded anymore to native request layer.

Just to explain why, in my app, I am fetching a DATA CSS Uri.

  • in my app the following code fetch(new URL('./file.css'))
  • is compiled by Vite as fetch(new URL('data:text/css,body{background:red}'))
  • so, while I am not intentionally fetching a data URI, it is compiled as such, because the resource is so small that Vite modifies it to an inline asset

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant