This commit is contained in:
Timothy Baldridge 2021-12-17 17:14:45 -07:00
parent 75aaec5fa2
commit 0446331c44
3 changed files with 8 additions and 7 deletions

View File

@ -75,6 +75,7 @@ public class ForceHeal : IVerb
validated = await _client.UploadPatch(validated, outData);
_logger.LogInformation("Patch Updated, validating result by downloading patch");
_logger.LogInformation("Checking URL {Url}", validated.PatchUrl);
using var patchStream = await _httpClient.GetAsync(validated.PatchUrl);
if (!patchStream.IsSuccessStatusCode)
throw new HttpException(patchStream);

View File

@ -257,9 +257,9 @@ public class Client
private async Task UpdateGitHubFile<T>(string owner, string repo, string path, T content, string oldSha)
{
var json = _dtos.Serialize(content);
var json = _dtos.Serialize(content, writeIndented: true);
var msg = await MakeMessage(HttpMethod.Post,
new Uri($"{_configuration.BuildServerUrl}/github/?owner={owner}&repo={repo}&path={path}&oldSha={oldSha}"));
new Uri($"{_configuration.BuildServerUrl}github/?owner={owner}&repo={repo}&path={path}&oldSha={oldSha}"));
msg.Content = new StringContent(json, Encoding.UTF8, "application/json");
using var result = await _client.SendAsync(msg);
@ -270,13 +270,13 @@ public class Client
private async Task<(string Sha, T Content)> GetGithubFile<T>(string owner, string repo, string path)
{
var msg = await MakeMessage(HttpMethod.Get,
new Uri($"{_configuration.BuildServerUrl}/github/?owner={owner}&repo={repo}&path={path}"));
new Uri($"{_configuration.BuildServerUrl}github/?owner={owner}&repo={repo}&path={path}"));
using var oldData = await _client.SendAsync(msg);
if (!oldData.IsSuccessStatusCode)
throw new HttpException(oldData);
var sha = oldData.Headers.GetValues(_configuration.ResponseShaHeader).First();
return (sha, (await oldData.Content.ReadFromJsonAsync<T>())!);
return (sha, (await oldData.Content.ReadFromJsonAsync<T>(_dtos.Options))!);
}

View File

@ -9,7 +9,7 @@ public class Configuration
public string MetricsKeyHeader { get; set; } = "x-metrics-key";
public string AuthorKeyHeader { get; set; } = "x-api-key";
public string ResponseShaHeader { get; set; } = "x-response-sha";
public string ResponseShaHeader { get; set; } = "x-content-sha";
public Uri ServerAllowList { get; set; } =
@ -21,7 +21,7 @@ public class Configuration
public Uri UpgradedArchives { get; set; } =
new("https://raw.githubusercontent.com/wabbajack-tools/mod-lists/master/reports/upgraded.json");
//public Uri BuildServerUrl { get; set; } = new("https://build.wabbajack.org/");
public Uri BuildServerUrl { get; set; } = new("http://localhost:5000/");
public Uri BuildServerUrl { get; set; } = new("https://build.wabbajack.org/");
//public Uri BuildServerUrl { get; set; } = new("http://localhost:5000/");
public string PatchBaseAddress { get; set; } = new("https://patches.wabbajack.org/");
}