Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default proxy to http:// if necessary, fixes #1282 #1283

Merged
merged 3 commits into from May 22, 2021
Merged

default proxy to http:// if necessary, fixes #1282 #1283

merged 3 commits into from May 22, 2021

Conversation

gurgeous
Copy link
Contributor

Previously, the proxy setting was silently ignored if you accidentally left off the scheme (something:1234). This change fills in the http:// if it seems to be missing. Fixes #1282.

Comment on lines 25 to 27
if value && !value[:uri].to_s.include?('://')
value[:uri] = Utils.URI("http://#{value[:uri]}")
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of having this check only in the case when String branch?
That looks like the most common use case, and if a URI or Options object is provided then probably the caller knows what they're doing (leaving the door open to override this automatic fix, if necessary)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea - how about this?

@iMacTia iMacTia merged commit 1f496a7 into lostisland:main May 22, 2021
@iMacTia
Copy link
Member

iMacTia commented May 22, 2021

Thanks @gurgeous, this looks great! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proxy silently ignored without http:
2 participants