aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFrederic Hemberger <mail@frederic-hemberger.de>2011-10-18 02:07:55 -0700
committerFrederic Hemberger <mail@frederic-hemberger.de>2011-10-18 02:07:55 -0700
commit8b1a441aa13b5859cfe28443fbc3a8db80ccc0a7 (patch)
tree99ee61ede28eb52d069fc22de87f5a1e8a43a49e /plugins
parentff7099207bc99edf9109f1b91f3e2aaf76560418 (diff)
parent92f57ad15bed843dfac44f387a892f31b5188fe8 (diff)
downloadmy_new_personal_website-8b1a441aa13b5859cfe28443fbc3a8db80ccc0a7.tar.xz
my_new_personal_website-8b1a441aa13b5859cfe28443fbc3a8db80ccc0a7.zip
Merge pull request #228 from mattn/proxy
Adds proxy support for gist_tag
Diffstat (limited to '')
-rw-r--r--plugins/gist_tag.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/gist_tag.rb b/plugins/gist_tag.rb
index ac5ee3c6..74dd3b37 100644
--- a/plugins/gist_tag.rb
+++ b/plugins/gist_tag.rb
@@ -71,7 +71,13 @@ module Jekyll
def get_gist_from_web(gist, file)
gist_url = get_gist_url_for gist, file
raw_uri = URI.parse gist_url
- https = Net::HTTP.new raw_uri.host, raw_uri.port
+ proxy = ENV['http_proxy']
+ if proxy
+ proxy_uri = URI.parse(proxy)
+ https = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port).new raw_uri.host, raw_uri.port
+ else
+ https = Net::HTTP.new raw_uri.host, raw_uri.port
+ end
https.use_ssl = true
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new raw_uri.request_uri