Closed gamer0mega closed 2 years ago
The issue seems to be that std does not specify the protocol field by default, unlike node. The code actually returns
error: Uncaught TypeError: error sending request for url (https://discord.comhttps//discord.com/api/v10/gateway): error trying to connect: dns error: Unknown host. (os error 11001)
await mayResponse,
^
at async mainFetch (deno:ext/fetch/26_fetch.js:287:14)
at async fetch (deno:ext/fetch/26_fetch.js:501:9)
at async HttpsClientRequest._final (https://deno.land/std@0.149.0/node/http.ts:136:7)
if I set protocol to https:
, this needs to be fixed aswell.
Describe the bug
Most HTTP Servers can handle a complete url as the request path, and in node, you can set it to a complete url. It just passes it to the HTTP header, while std just yields an error about invalid url.
Steps to Reproduce
Expected behavior
As in node.
Environment