aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index e1f1b6b98..818354993 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -244,6 +244,8 @@ module GitHub extend self
Error = Class.new(StandardError)
def open url, headers={}, &block
+ require 'net/https' # for exception classes below
+
default_headers = {'User-Agent' => HOMEBREW_USER_AGENT}
default_headers['Authorization'] = "token #{HOMEBREW_GITHUB_API_TOKEN}" if HOMEBREW_GITHUB_API_TOKEN
Kernel.open(url, default_headers.merge(headers), &block)