Fix digest tests and update controllers with new digest attribute

This commit is contained in:
Slendy 2024-02-29 18:27:26 -06:00
commit d458eb90ad
No known key found for this signature in database
GPG key ID: 7288D68361B91428
29 changed files with 178 additions and 267 deletions

View file

@ -1,22 +1,17 @@
#nullable enable
using System.Text;
using LBPUnion.ProjectLighthouse.Extensions;
using LBPUnion.ProjectLighthouse.Files;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Servers.GameServer.Types;
using LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Misc;
using LBPUnion.ProjectLighthouse.Types.Logging;
using LBPUnion.ProjectLighthouse.Types.Resources;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using IOFile = System.IO.File;
namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers.Resources;
[ApiController]
[Authorize]
[Produces("text/xml")]
[Route("LITTLEBIGPLANETPS3_XML")]
public class ResourcesController : ControllerBase
public class ResourcesController : GameController
{
[HttpPost("showModerated")]
@ -51,6 +46,7 @@ public class ResourcesController : ControllerBase
[HttpPost("upload/{hash}/unattributed")]
[HttpPost("upload/{hash}")]
[UseDigest(DigestHeaderName = "X-Digest-B", ExcludeBodyFromDigest = true)]
public async Task<IActionResult> UploadResource(string hash)
{
string assetsDirectory = FileHelper.ResourcePath;