oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.32k stars 2.78k forks source link

HTTPS options setup issue causing wrong port #14123

Open harveyalex opened 1 month ago

harveyalex commented 1 month ago

What version of Bun is running?

1.1.33

What platform is your computer?

Darwin 23.5.0 arm64 arm

What steps can reproduce the bug?

Edit: Ignore below, to recreate, there is are repo here: https://github.com/harveyalex/bun-zlib-issue

To recreate the issuse, I have created a simple repo with steps to recreate here when you run the code, with a debugger, you can step through and see that it lands on a file in superagent/lib/node/index.js on line 366, where the zlib is being used.

What is the expected behavior?

That the port of the https request is 443 not 80

What do you see instead?

The port of the request object being 80

Additional information

No response

nektro commented 1 month ago

this may have been fixed by https://github.com/oven-sh/bun/pull/14079, if the issue persists after upgrading to the latest canary and/or 1.1.30, please let us know

harveyalex commented 3 weeks ago

@nektro this is still an issue

Jarred-Sumner commented 3 weeks ago

@harveyalex judging by the error, this is unlikely a zlib issue and more likely a DNS or node:https or node:tls issue. It’s attempting to connect to port 80 over https. So that sounds like a bug with https when using an agent.

harveyalex commented 3 weeks ago

@Jarred-Sumner Hey thanks for looking into this! I have updated the reproduce repo, it seems that it is an issue with it trying to use port 80 like you said, the issue comes about when you use https.request and have options of agent: false. The port gets set to 80 which causes the issue