Skip to content

Commit bc55240

Browse files
[Workers] Service binding URL requirement (#21288)
* Service binding URL requirement * Update src/content/docs/workers/runtime-apis/bindings/service-bindings/http.mdx Co-authored-by: Greg Brimble <[email protected]> * Update src/content/docs/workers/runtime-apis/bindings/service-bindings/http.mdx --------- Co-authored-by: Greg Brimble <[email protected]>
1 parent cfefad2 commit bc55240

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 construct a new request manually, rather than forwarding an existing one, ensure that you provide a valid and fully-qualified 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)