File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -346,12 +346,12 @@ const data = await ofetch("https://icanhazip.com");
346346** Example:** Allow self-signed certificates (USE AT YOUR OWN RISK!)
347347
348348``` ts
349- import { Agent } from " undici" ;
349+ import { ProxyAgent } from " undici" ;
350350import { ofetch } from " ofetch" ;
351351
352352// Note: This makes fetch unsecure against MITM attacks. USE AT YOUW OWN RISK!
353- const unsecureAgent = new Agent ({ connect : { rejectUnauthorized: false } });
354- const unsecureFetch = ofetch .create ({ dispatcher: unsecureAgent });
353+ const unsecureProxyAgent = new ProxyAgent ({ requestTls : { rejectUnauthorized: false } });
354+ const unsecureFetch = ofetch .create ({ dispatcher: unsecureProxyAgent });
355355
356356const data = await unsecureFetch (" https://www.squid-cache.org/" );
357357```
You can’t perform that action at this time.
0 commit comments