You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a workaround, I believe you should be able to pass in the URL and headers directly into the fetch
ie. const resp = await gatewayWorker.fetch("www.test.com", { headers: { Cookie: "country_code=us", }, });
I could therefore ensure both Request objects were equal, and in my test I tried:
worker=awaitunstable_dev("main.js",{experimental: {disableExperimentalWarning: true},});// create a new Request object from the Request from Wranglerconstreq=newworker.request(`http://example.com`);// pass their Request into themconstresp=awaitworker.fetch(req);
and it works as expected ✅. Anyways not a solution, but figured I'd share what I found.
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
3.12.0 [Wrangler]
What version of Node are you using?
18.17.1
What operating system are you using?
Mac
Describe the Bug
Testing a worker using
unstable_dev
fails to parse URL when using aRequest
object.Example:
Please provide a link to a minimal reproduction
See example code above
Please provide any relevant error logs
Jest output:
The text was updated successfully, but these errors were encountered: