Files
MegghysAPI/Controllers/PublicController.cs
2025-02-26 08:07:32 +08:00

21 lines
542 B
C#

using Microsoft.AspNetCore.Mvc;
namespace MegghysAPI.Controllers
{
[Route("api/public")]
[ApiController]
public class PublicController : MControllerBase
{
[HttpGet("header")]
public IActionResult Header(bool? order = false)
{
var headers = Request.Headers.Select(h => $"{h.Key}: {h.Value}");
if (order == true)
{
headers = headers.OrderBy(h => h);
}
return Ok(string.Join(Environment.NewLine, headers));
}
}
}