Skip to content

Commit 04f0959

Browse files
authored
fix: change verification endpoint from GET to POST (#50)
- GeneralUpdate.ClientCore sends POST (PostTaskAsync), not GET - Added form body fallback for parameters - Fixes empty response / JsonException
1 parent 2b385f4 commit 04f0959

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/Services/LocalUpdateServer.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ public async Task StartAsync(int port = 5000)
2929

3030
_app = builder.Build();
3131

32-
// GET /Upgrade/Verification
33-
_app.MapGet("/Upgrade/Verification", async (HttpContext context) =>
32+
// POST /Upgrade/Verification
33+
_app.MapPost("/Upgrade/Verification", async (HttpContext context) =>
3434
{
3535
var q = context.Request.Query;
3636
var currentVer = q["currentVersion"].ToString();
37+
// Fallback: read from form body if query string is empty
38+
if (string.IsNullOrEmpty(currentVer) && context.Request.HasFormContentType)
39+
{
40+
var form = await context.Request.ReadFormAsync();
41+
currentVer = form["currentVersion"].ToString();
42+
}
3743
_ = int.TryParse(q["appType"].ToString(), out var appType);
3844

3945
var match = Updates.Find(u => u.CurrentVersion == currentVer);

0 commit comments

Comments
 (0)