octokit 1.15.0 → 1.15.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +1 -0
- data/lib/octokit/configuration.rb +2 -0
- data/lib/octokit/request.rb +2 -0
- data/lib/octokit/version.rb +1 -1
- data/spec/octokit/client_spec.rb +33 -0
- metadata +1 -1
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
* [1.15.1 - September 24,2012](https://github.com/pengwynn/octokit/compare/v1.15.0...v1.15.1)
|
3
4
|
* [1.15.0 - September 24,2012](https://github.com/pengwynn/octokit/compare/v1.14.0...v1.15.0)
|
4
5
|
* [1.14.0 - September 22,2012](https://github.com/pengwynn/octokit/compare/v1.13.0...v1.14.0)
|
5
6
|
* [1.13.0 - September 5, 2012](https://github.com/pengwynn/octokit/compare/v1.12.0...v1.13.0)
|
@@ -15,6 +15,7 @@ module Octokit
|
|
15
15
|
:client_id,
|
16
16
|
:client_secret,
|
17
17
|
:user_agent,
|
18
|
+
:request_host,
|
18
19
|
:auto_traversal,
|
19
20
|
:per_page].freeze
|
20
21
|
|
@@ -58,6 +59,7 @@ module Octokit
|
|
58
59
|
self.oauth_token = nil
|
59
60
|
self.client_id = nil
|
60
61
|
self.client_secret = nil
|
62
|
+
self.request_host = nil
|
61
63
|
self.user_agent = DEFAULT_USER_AGENT
|
62
64
|
self.auto_traversal = DEFAULT_AUTO_TRAVERSAL
|
63
65
|
end
|
data/lib/octokit/request.rb
CHANGED
data/lib/octokit/version.rb
CHANGED
data/spec/octokit/client_spec.rb
CHANGED
@@ -106,5 +106,38 @@ describe Octokit::Client do
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
+
describe "request_host" do
|
110
|
+
after(:each) { Octokit.reset }
|
111
|
+
|
112
|
+
it "should default to nil" do
|
113
|
+
client = Octokit::Client.new
|
114
|
+
client.request_host.should be_nil
|
115
|
+
end
|
116
|
+
|
117
|
+
it "should be settable" do
|
118
|
+
Octokit.request_host = 'github.company.com'
|
119
|
+
client = Octokit::Client.new
|
120
|
+
client.request_host.should == 'github.company.com'
|
121
|
+
end
|
122
|
+
|
123
|
+
it "does not change the Host header when not set" do
|
124
|
+
Octokit.api_endpoint = 'http://github.internal'
|
125
|
+
|
126
|
+
stub_request(:any, /.*/)
|
127
|
+
req = stub_request(:get, 'http://github.internal/users/me').with(:headers => { 'Host' => /.*/})
|
128
|
+
Octokit.user "me"
|
129
|
+
req.should_not have_been_requested
|
130
|
+
end
|
131
|
+
|
132
|
+
it "changes the Host header when set" do
|
133
|
+
Octokit.api_endpoint = 'http://github.internal'
|
134
|
+
Octokit.request_host = 'github.company.com'
|
135
|
+
|
136
|
+
req = stub_request(:get, 'http://github.internal/users/me').with(:headers => { 'Host' => 'github.company.com' })
|
137
|
+
Octokit.user "me"
|
138
|
+
req.should have_been_requested
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
109
142
|
|
110
143
|
end
|