Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91bdde3797 | ||
|
|
e5ab911dfd | ||
|
|
042f806697 | ||
|
|
a4c8cf5955 | ||
|
|
d1f3fd1125 | ||
|
|
b05782d4e9 | ||
|
|
d7c89327a7 | ||
|
|
03048b793d | ||
|
|
1d9cf795dd | ||
|
|
7dbab1aab8 | ||
|
|
078d2f80be | ||
|
|
c986a98471 | ||
|
|
57a45d91df | ||
|
|
c6b2330e1d | ||
|
|
9737316dbc | ||
|
|
a4e006f84f | ||
|
|
3cdf8bc7e2 | ||
|
|
67f3095896 |
@@ -9,14 +9,6 @@ public class RequestLoggerMiddleware
|
|||||||
private readonly ILogger<RequestLoggerMiddleware> _logger;
|
private readonly ILogger<RequestLoggerMiddleware> _logger;
|
||||||
private readonly RequestDelegate _next;
|
private readonly RequestDelegate _next;
|
||||||
|
|
||||||
// Keywords used to surface social/squad/invite traffic while reverse-engineering the
|
|
||||||
// squad-invite flow (see SQUAD-EMULATION.md). Matched against the path AND the body
|
|
||||||
// (the CloudScript function name lives in the body of /Client/ExecuteFunction).
|
|
||||||
private static readonly string[] SocialKeywords =
|
|
||||||
{
|
|
||||||
"group", "party", "lobby", "squad", "invite", "friend", "social", "matchmak",
|
|
||||||
};
|
|
||||||
|
|
||||||
public RequestLoggerMiddleware(ILogger<RequestLoggerMiddleware> logger, RequestDelegate next)
|
public RequestLoggerMiddleware(ILogger<RequestLoggerMiddleware> logger, RequestDelegate next)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
@@ -40,27 +32,6 @@ public class RequestLoggerMiddleware
|
|||||||
}
|
}
|
||||||
|
|
||||||
await _next(context);
|
await _next(context);
|
||||||
|
|
||||||
// ── Capture pass (squad-invite RE, see SQUAD-EMULATION.md) ──────────────
|
|
||||||
// Runs AFTER the pipeline so we know whether the request was actually routed.
|
|
||||||
if (context.Request.Method == "POST")
|
|
||||||
{
|
|
||||||
var path = context.Request.Path.Value ?? "";
|
|
||||||
var haystack = (path + " " + body).ToLowerInvariant();
|
|
||||||
|
|
||||||
// Any POST that fell through to a 404 = an endpoint the emulator does NOT implement
|
|
||||||
// (e.g. a native PlayFab /Group/CreateGroup or /Lobby/* the client tried to call).
|
|
||||||
if (context.Response.StatusCode == 404)
|
|
||||||
{
|
|
||||||
_logger.LogWarning("[CAPTURE UNROUTED] {Method} {Url} -> 404 | Body {Body}",
|
|
||||||
context.Request.Method, context.Request.GetDisplayUrl(), body);
|
|
||||||
}
|
|
||||||
else if (SocialKeywords.Any(k => haystack.Contains(k)))
|
|
||||||
{
|
|
||||||
_logger.LogInformation("[CAPTURE SOCIAL] {Url} ({Status}) | Body {Body}",
|
|
||||||
context.Request.GetDisplayUrl(), context.Response.StatusCode, body);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<string> RequestAsync(HttpRequest request)
|
private static async Task<string> RequestAsync(HttpRequest request)
|
||||||
|
|||||||
Reference in New Issue
Block a user