Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Fix downloading HTTPS file with HTTP proxy #584

Merged
merged 1 commit into from Mar 18, 2020
Merged

Conversation

orzFly
Copy link
Contributor

@orzFly orzFly commented Mar 18, 2020

HttpProxyAgent connects to a specified HTTP or HTTPS proxy server for HTTP requests.
HttpsProxyAgent connects to a specified HTTP or HTTPS proxy server for HTTPS requests.

So we should choose agent based on the destination instead of the proxy URL.

HttpProxyAgent connects to a specified HTTP or HTTPS proxy server for HTTP requests.
HttpsProxyAgent connects to a specified HTTP or HTTPS proxy server for HTTPS requests.

So we should choose agent based on the destination instead of the proxy URL.
@CLAassistant
Copy link

CLAassistant commented Mar 18, 2020

CLA assistant check
All committers have signed the CLA.

@orzFly
Copy link
Contributor Author

orzFly commented Mar 18, 2020

The CLA was signed accidentally (I didn't have a time to review and the web page just told me I have already signed). I am requesting approval from my employer.

@orzFly
Copy link
Contributor Author

orzFly commented Mar 18, 2020

CLA confirmed.

@orzFly orzFly marked this pull request as ready for review March 18, 2020 05:31
@janpio janpio requested a review from Jolg42 March 18, 2020 11:16
@janpio
Copy link
Member

janpio commented Mar 18, 2020

Oh, interesting - did we misunderstand how that should work? If so, I think that could explain some of the problems I was having when playing with proxies locally to debug something unrelated.

@janpio janpio added this to the Preview 25 milestone Mar 18, 2020
@janpio janpio added bug/1-repro-available A reproduction exists and needs to be confirmed. kind/bug A reported bug. labels Mar 18, 2020
@Jolg42
Copy link
Member

Jolg42 commented Mar 18, 2020

Nice catch! Thank you @orzFly for the PR 💯

I randomly found that npm does that too indeed https://github.com/npm/make-fetch-happen/blob/c389a1e567327359aa4b34dbf805989ecbd9755b/agent.js

@Jolg42 Jolg42 closed this Mar 18, 2020
@Jolg42 Jolg42 merged commit ff71b38 into prisma:master Mar 18, 2020
@Jolg42 Jolg42 removed their request for review March 18, 2020 16:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/1-repro-available A reproduction exists and needs to be confirmed. kind/bug A reported bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants