我有一个由 Cloudflare 代理的 Web 应用程序,运行在hybrid-app.example
我正在使用Cloudflare Worker Sites模式在hybrid-app.example/static-content/. 这个工人正在监听路线*hybrid-app.example/static-content*。https://hybrid-app.example/static-content/hello.html我可以通过导航到并从我的静态站点中查看正确的内容来验证此工作器的配置是否正确。
我还有第二个 Cloudflare 工作者,它使用工作者路由器模式将静态站点中的选择页面代理到同一域上的虚 URL。特别是,这个工人被配置为监听路由*hybrid-app.example/hello*。在内部,它执行以下操作:
return fetch('https://hybrid-app.example/static-content/hello.html')
但是当我导航到 时https://hybrid-app.example/hello,我看到一个GET请求访问/static-content/hello.html我的源服务器。因此,当我fetch在 Cloudflare 工作程序中调用函数时,它似乎在解析请求而不检查与任何其他工作程序路由的匹配。我可以使用 Fetch API 的替代方法来强制来自一个 cloudflare 工作人员的请求,以在解析之前检查其他匹配的 CF 工作人员路由吗?