feat: add support of cloudflare workers (#596)

This commit is contained in:
Ayoub
2024-03-31 14:37:06 +00:00
committed by GitHub
parent d589365ea2
commit 2029aec90d
8 changed files with 142 additions and 4 deletions

View File

@@ -140,8 +140,8 @@ export default class HTTPClient {
const response = await this.#fetch(request, {
body: request_body,
headers: request_headers,
credentials: 'include',
redirect: input instanceof Platform.shim.Request ? input.redirect : init?.redirect || 'follow'
redirect: input instanceof Platform.shim.Request ? input.redirect : init?.redirect || 'follow',
...(Platform.shim.runtime !== 'cf-worker' ? { credentials: 'include' } : {})
});
// Check if 2xx