Fix/add proxy auth when using fetch#106
Fix/add proxy auth when using fetch#106LaustDengsoe wants to merge 4 commits intodegoog-org:developfrom
Conversation
|
Oh that's very valid! |
|
hey @LaustDengsoe The breaking change was due to the fact that you were going to port 80 if a port was a number or the protocol was http. If you passed port 1234 that'd return Number(1234) which is truthy, returning port 80 as a result.
You want it to be
Let me know if it works for you, if you confirm I'll merge, good job overall, this is a great addition ❤️ |
|
Thanks, what an oversight, sorry xD I can confirm, that it works :) |
|
Oh I see, now I am the one oversighting things hahh I think it should be fine, but I wanna triple check in the morning, hang in there 😆 |
I found that the
fetchtransport mode didn't work when using a proxy of the format:http://user:pass@proxy:port.This meant that pressing "Test proxy connection" in the settings would fail, but if the
curltransport mode was used, one would still be able to search as per usual. However, if using thefetchtransport mode, searching would not work.I have made an attempt at fixing this, so that the
fetchtransport mode now supports Basic authentication.However, these changes are breaking, since the default port is now either 80 or 443 based on the protocol of the proxy.
This is because the
new URL(proxyUrl);ignores the default port (i.e. 80 or 443), resulting inurl.portbeing an empty string, which would result in port 8080 being used previously.Please let me know if I need to change anything! :)