From 2efd6f70e28f79e96c30b317a3b6be229a9200e0 Mon Sep 17 00:00:00 2001 From: Josh Gross Date: Tue, 25 Feb 2020 18:30:33 -0500 Subject: [PATCH] Use the Uri Scheme in the register runner url (#345) --- src/Runner.Listener/Configuration/ConfigurationManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Runner.Listener/Configuration/ConfigurationManager.cs b/src/Runner.Listener/Configuration/ConfigurationManager.cs index cbea73b17..a2fe2a312 100644 --- a/src/Runner.Listener/Configuration/ConfigurationManager.cs +++ b/src/Runner.Listener/Configuration/ConfigurationManager.cs @@ -522,8 +522,8 @@ namespace GitHub.Runner.Listener.Configuration private async Task GetTenantCredential(string githubUrl, string githubToken) { var gitHubUrlBuilder = new UriBuilder(githubUrl); - var githubApiUrl = $"https://api.{gitHubUrlBuilder.Host}/actions/runner-registration"; - using (var httpClientHandler = HostContext.CreateHttpClientHandler()) + var githubApiUrl = $"{gitHubUrlBuilder.Scheme}://api.{gitHubUrlBuilder.Host}/actions/runner-registration"; + using (var httpClientHandler = HostContext.CreateHttpClientHandler()) using (var httpClient = new HttpClient(httpClientHandler)) { httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("RemoteAuth", githubToken);