mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-16 06:32:28 +00:00
Fix slot version bug and other improvements (#281)
* Fix slot version bug and other improvements * Fix upload tests not authenticating Co-authored-by: jvyden <jvyden@jvyden.xyz>
This commit is contained in:
parent
3aecccedf2
commit
216cd2e198
7 changed files with 104 additions and 35 deletions
|
@ -73,6 +73,16 @@ public class LighthouseServerTest
|
|||
return await this.Client.PostAsync($"/LITTLEBIGPLANETPS3_XML/upload/{hash}", new ByteArrayContent(bytes));
|
||||
}
|
||||
|
||||
public async Task<HttpResponseMessage> AuthenticatedUploadFileEndpointRequest(string filePath, string mmAuth)
|
||||
{
|
||||
byte[] bytes = await File.ReadAllBytesAsync(filePath);
|
||||
string hash = HashHelper.Sha1Hash(bytes).ToLower();
|
||||
using HttpRequestMessage requestMessage = new(HttpMethod.Post, $"/LITTLEBIGPLANETPS3_XML/upload/{hash}");
|
||||
requestMessage.Headers.Add("Cookie", mmAuth);
|
||||
requestMessage.Content = new ByteArrayContent(bytes);
|
||||
return await this.Client.SendAsync(requestMessage);
|
||||
}
|
||||
|
||||
public async Task<HttpResponseMessage> UploadFileRequest(string endpoint, string filePath)
|
||||
=> await this.Client.PostAsync(endpoint, new StringContent(await File.ReadAllTextAsync(filePath)));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue