Add Cloudflare (Dyte) as a provider of call #2

Merged
LittleSheep merged 4 commits from refactor/cloudflare-call into master 2025-07-11 18:28:06 +00:00
10 changed files with 558 additions and 159 deletions
Showing only changes of commit da4ee81c95 - Show all commits

View File

@@ -31,7 +31,10 @@ public class ClientTypeMiddleware(RequestDelegate next)
context.Items["IsWebPage"] = isWebPage;
if (!isWebPage && context.Request.Path != "/ws" && !context.Request.Path.StartsWithSegments("/api"))
var redirectWhiteList = new[] { "/ws", "/.well-known", "/swagger" };
if(redirectWhiteList.Any(w => context.Request.Path.StartsWithSegments(w)))
await next(context);
else if (!isWebPage && !context.Request.Path.StartsWithSegments("/api"))
context.Response.Redirect(
$"/api{context.Request.Path.Value}{context.Request.QueryString.Value}",
permanent: false