Updates to the Proxy Handling #1
Conversation
retrieve hub-detect.ps1. Updating detect.ps to not truncate the proxy address when you have a port associated with it.
|
Hello Kevin Still, These are great ideas and thank you very much for the PR. If I understand what you are trying to accomplish:
To that end, I think the implementation should be approached a little differently. I will open a new PR and incorporate your concepts and add you to the PR so you can contribute. How does that sound? |
Feel free to make another PR with your changes. |
|
I do wonder if the protocol works all the way through detect, I'll create a ticket for detect to confirm. In theory, the TFS/Powershell can use the uri builder to only pass the host and not the scheme. I've opened the new PR: #2 I believe it addresses both issues. Thanks! |
detect-task.ps1:
When hub is running on a machine that does not have direct outside internet connection it won't be able to reach the github repository to download the newest version of detect.ps1. This change uses the Hub Proxy settings with the Invoke-RestMethod to use the proxy to get outside access. If you are not using the proxy it does nothing different.
detect.ps1
Previously the Proxy Url builder would end up returning an empty string with the way this was parsing. Now we are using the Proxy's string to create the new URIBuilder object and then assigning the port. Now when we call ProxyUrlBuilder.Uri we actually get a correctly configured Uri verses an empty value which ends up throwing an exception.
Test Code:
Output Before:
Output After: