Skip to content

Commit b16736f

Browse files
committed
Service binding URL requirement
1 parent bbff613 commit b16736f

File tree

1 file changed

+17
-0
lines changed
  • src/content/docs/workers/runtime-apis/bindings/service-bindings

1 file changed

+17
-0
lines changed

src/content/docs/workers/runtime-apis/bindings/service-bindings/http.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,20 @@ export default {
5656
},
5757
};
5858
```
59+
60+
:::note
61+
62+
If you create a new request manually, rather than forwarding an existing one, you need to provide a valid URL with a hostname. For example:
63+
64+
```js
65+
export default {
66+
async fetch(request, env) {
67+
// provide a valid URL
68+
let newRequest = new Request("https://valid-url.com", { method: "GET" });
69+
let response = await env.WORKER_B.fetch(newRequest);
70+
return response;
71+
}
72+
};
73+
```
74+
75+
:::

0 commit comments

Comments
 (0)