I've been using the Router from itty-router in a Cloudflare Worker, and I've encountered some unexpected behavior during its usage. The simplified logic of the code is to return the content of https://example.com upon receiving a user request.
// Without using itty-router
export default {
async fetch(request) {
return await fetch('https://example.com');
}
}
When testing in the local development environment using curl, I received the normal HTML content from example.com:
I've been using the
Router
fromitty-router
in a Cloudflare Worker, and I've encountered some unexpected behavior during its usage. The simplified logic of the code is to return the content ofhttps://example.com
upon receiving a user request.When testing in the local development environment using curl, I received the normal HTML content from example.com:
After introducing
itty-router
:Continuing the test with
curl http://localhost:8787/test
, I received the following response:Could someone please explain what might be causing this issue?