@@ -42,7 +42,11 @@ func TestReadConfig(t *testing.T) {
4242 {
4343 name : "defaults" ,
4444 want : & config {
45- Endpoint : "https://sourcegraph.com" ,
45+ Endpoint : "https://sourcegraph.com" ,
46+ EndpointURL : & url.URL {
47+ Scheme : "https" ,
48+ Host : "sourcegraph.com" ,
49+ },
4650 AdditionalHeaders : map [string ]string {},
4751 },
4852 },
@@ -54,7 +58,11 @@ func TestReadConfig(t *testing.T) {
5458 Proxy : "https://proxy.com:8080" ,
5559 },
5660 want : & config {
57- Endpoint : "https://example.com" ,
61+ Endpoint : "https://example.com" ,
62+ EndpointURL : & url.URL {
63+ Scheme : "https" ,
64+ Host : "example.com" ,
65+ },
5866 AccessToken : "deadbeef" ,
5967 AdditionalHeaders : map [string ]string {},
6068 Proxy : "https://proxy.com:8080" ,
@@ -95,6 +103,10 @@ func TestReadConfig(t *testing.T) {
95103 envProxy : "socks5://other.proxy.com:9999" ,
96104 want : & config {
97105 Endpoint : "https://example.com" ,
106+ EndpointURL : & url.URL {
107+ Scheme : "https" ,
108+ Host : "example.com" ,
109+ },
98110 AccessToken : "deadbeef" ,
99111 Proxy : "socks5://other.proxy.com:9999" ,
100112 ProxyPath : "" ,
@@ -117,6 +129,10 @@ func TestReadConfig(t *testing.T) {
117129 envProxy : "socks5://other.proxy.com:9999" ,
118130 want : & config {
119131 Endpoint : "https://override.com" ,
132+ EndpointURL : & url.URL {
133+ Scheme : "https" ,
134+ Host : "override.com" ,
135+ },
120136 AccessToken : "abc" ,
121137 Proxy : "socks5://other.proxy.com:9999" ,
122138 ProxyPath : "" ,
@@ -132,6 +148,10 @@ func TestReadConfig(t *testing.T) {
132148 envToken : "abc" ,
133149 want : & config {
134150 Endpoint : "https://sourcegraph.com" ,
151+ EndpointURL : & url.URL {
152+ Scheme : "https" ,
153+ Host : "sourcegraph.com" ,
154+ },
135155 AccessToken : "abc" ,
136156 AdditionalHeaders : map [string ]string {},
137157 },
@@ -141,6 +161,10 @@ func TestReadConfig(t *testing.T) {
141161 envEndpoint : "https://example.com" ,
142162 want : & config {
143163 Endpoint : "https://example.com" ,
164+ EndpointURL : & url.URL {
165+ Scheme : "https" ,
166+ Host : "example.com" ,
167+ },
144168 AccessToken : "" ,
145169 AdditionalHeaders : map [string ]string {},
146170 },
@@ -150,6 +174,10 @@ func TestReadConfig(t *testing.T) {
150174 envProxy : "https://proxy.com:8080" ,
151175 want : & config {
152176 Endpoint : "https://sourcegraph.com" ,
177+ EndpointURL : & url.URL {
178+ Scheme : "https" ,
179+ Host : "sourcegraph.com" ,
180+ },
153181 AccessToken : "" ,
154182 Proxy : "https://proxy.com:8080" ,
155183 ProxyPath : "" ,
@@ -167,6 +195,10 @@ func TestReadConfig(t *testing.T) {
167195 envProxy : "https://proxy.com:8080" ,
168196 want : & config {
169197 Endpoint : "https://example.com" ,
198+ EndpointURL : & url.URL {
199+ Scheme : "https" ,
200+ Host : "example.com" ,
201+ },
170202 AccessToken : "abc" ,
171203 Proxy : "https://proxy.com:8080" ,
172204 ProxyPath : "" ,
@@ -182,6 +214,10 @@ func TestReadConfig(t *testing.T) {
182214 envProxy : "unix://" + socketPath ,
183215 want : & config {
184216 Endpoint : "https://sourcegraph.com" ,
217+ EndpointURL : & url.URL {
218+ Scheme : "https" ,
219+ Host : "sourcegraph.com" ,
220+ },
185221 Proxy : "unix://" + socketPath ,
186222 ProxyPath : socketPath ,
187223 ProxyURL : nil ,
@@ -193,6 +229,10 @@ func TestReadConfig(t *testing.T) {
193229 envProxy : socketPath ,
194230 want : & config {
195231 Endpoint : "https://sourcegraph.com" ,
232+ EndpointURL : & url.URL {
233+ Scheme : "https" ,
234+ Host : "sourcegraph.com" ,
235+ },
196236 Proxy : socketPath ,
197237 ProxyPath : socketPath ,
198238 ProxyURL : nil ,
@@ -204,6 +244,10 @@ func TestReadConfig(t *testing.T) {
204244 envProxy : "socks://localhost:1080" ,
205245 want : & config {
206246 Endpoint : "https://sourcegraph.com" ,
247+ EndpointURL : & url.URL {
248+ Scheme : "https" ,
249+ Host : "sourcegraph.com" ,
250+ },
207251 Proxy : "socks://localhost:1080" ,
208252 ProxyPath : "" ,
209253 ProxyURL : & url.URL {
@@ -218,6 +262,10 @@ func TestReadConfig(t *testing.T) {
218262 envProxy : "socks5h://localhost:1080" ,
219263 want : & config {
220264 Endpoint : "https://sourcegraph.com" ,
265+ EndpointURL : & url.URL {
266+ Scheme : "https" ,
267+ Host : "sourcegraph.com" ,
268+ },
221269 Proxy : "socks5h://localhost:1080" ,
222270 ProxyPath : "" ,
223271 ProxyURL : & url.URL {
@@ -237,6 +285,10 @@ func TestReadConfig(t *testing.T) {
237285 },
238286 want : & config {
239287 Endpoint : "https://override.com" ,
288+ EndpointURL : & url.URL {
289+ Scheme : "https" ,
290+ Host : "override.com" ,
291+ },
240292 AccessToken : "deadbeef" ,
241293 AdditionalHeaders : map [string ]string {},
242294 },
@@ -248,6 +300,10 @@ func TestReadConfig(t *testing.T) {
248300 envToken : "abc" ,
249301 want : & config {
250302 Endpoint : "https://override.com" ,
303+ EndpointURL : & url.URL {
304+ Scheme : "https" ,
305+ Host : "override.com" ,
306+ },
251307 AccessToken : "abc" ,
252308 AdditionalHeaders : map [string ]string {},
253309 },
@@ -260,6 +316,10 @@ func TestReadConfig(t *testing.T) {
260316 envFooHeader : "bar" ,
261317 want : & config {
262318 Endpoint : "https://override.com" ,
319+ EndpointURL : & url.URL {
320+ Scheme : "https" ,
321+ Host : "override.com" ,
322+ },
263323 AccessToken : "abc" ,
264324 AdditionalHeaders : map [string ]string {"foo" : "bar" },
265325 },
@@ -272,6 +332,10 @@ func TestReadConfig(t *testing.T) {
272332 envHeaders : "foo:bar\n foo-bar:bar-baz" ,
273333 want : & config {
274334 Endpoint : "https://override.com" ,
335+ EndpointURL : & url.URL {
336+ Scheme : "https" ,
337+ Host : "override.com" ,
338+ },
275339 AccessToken : "abc" ,
276340 AdditionalHeaders : map [string ]string {"foo-bar" : "bar-baz" , "foo" : "bar" },
277341 },
0 commit comments