Open
Description
What versions & operating system are you using?
vite: 6.3.5, wrangler: 4.19.2, @cloudflare/vite-plugin: ^1.5.1
Please provide a link to a minimal reproduction
No response
Describe the Bug
You need to have
- Two workers with a service binding between them
- Run the worker using
vite dev
with cloudflare-vite-plugin - Try to call fetch using a service binding
Code in the worker
export default {
async fetch(request, env) {
await env.WORKER_API.fetch(request); <-- works
await env.WORKER_API.fetch(new Request("http://internal/api")); <- doesn't work
}
}
this code works when you try to run it using wrangler dev
,
I found out that if you don't have the "host"
header specified in a custom request instance then the request fails with status: 400
and text: "Bad Request"
.
Please provide any relevant error logs
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Untriaged