2021-11-17 08:36:23 -05:00
|
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
2022-10-12 06:36:30 -04:00
|
|
|
|
namespace Jupiter.Controllers
|
2021-11-17 08:36:23 -05:00
|
|
|
|
{
|
2023-07-27 11:20:47 -04:00
|
|
|
|
[ApiController]
|
|
|
|
|
|
[Route("api/v1/c/_debug")]
|
|
|
|
|
|
public class DebugController : Controller
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Return bytes of specified length with auth, used for testing only
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("getBytes")]
|
|
|
|
|
|
[Authorize]
|
|
|
|
|
|
public IActionResult GetBytes([FromQuery] int length = 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GenerateByteResponse(length);
|
|
|
|
|
|
}
|
2024-03-20 09:54:46 -04:00
|
|
|
|
|
2023-07-27 11:20:47 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Return bytes of specified length without auth, used for testing only
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("getBytesWithoutAuth")]
|
|
|
|
|
|
public IActionResult GetBytesWithoutAuth([FromQuery] int length = 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GenerateByteResponse(length);
|
|
|
|
|
|
}
|
2021-11-17 08:36:23 -05:00
|
|
|
|
|
2023-07-27 11:20:47 -04:00
|
|
|
|
private FileContentResult GenerateByteResponse(int length)
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] generatedData = new byte[length];
|
|
|
|
|
|
Array.Fill(generatedData, (byte)'J');
|
|
|
|
|
|
return File(generatedData, "application/octet-stream");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-11-17 08:36:23 -05:00
|
|
|
|
}
|