Created
April 17, 2015 09:09
-
-
Save rochefort/16bb08677b87d33e87b6 to your computer and use it in GitHub Desktop.
homebrew hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ diff open-uri.rb /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb ◼ | |
| --- open-uri.rb 2015-04-17 18:07:12.000000000 +0900 | |
| +++ /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb 2015-04-17 18:06:40.000000000 +0900 | |
| @@ -253,6 +253,10 @@ | |
| def OpenURI.open_http(buf, target, proxy, options) # :nodoc: | |
| if proxy | |
| proxy_uri, proxy_user, proxy_pass = proxy | |
| + if proxy_uri.userinfo | |
| + proxy_user, proxy_pass = proxy_uri.userinfo.split(':') | |
| + proxy_uri = URI.parse(proxy_uri.scheme + '://' + proxy_uri.host + ':' + proxy_uri.port.to_s) | |
| + end | |
| raise "Non-HTTP proxy URI: #{proxy_uri}" if proxy_uri.class != URI::HTTP | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment