Initial_commit_SecMPS_v2

This commit is contained in:
2026-05-15 23:22:48 +08:00
commit 23ea4fe05f
13830 changed files with 298675 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using VolPro.Core.Language;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace VolPro.Core.Middleware
{
public class LanguageMiddleWare
{
private readonly RequestDelegate next;
public LanguageMiddleWare(RequestDelegate next)
{
this.next = next;
}
public async Task Invoke(HttpContext context)
{
if (context.Request.Path.Value.StartsWith("/lang"))
{
context.Response.Headers.TryAdd("Access-Control-Allow-Origin", "*");
context.Response.ContentType = "application/json";
//application/json
}
if (!context.Request.Headers.ContainsKey("lang"))
{
context.Request.Headers["lang"] = LangConst.;
}
await next(context);
}
}
}