pleroma: encode id in ChangeScope

This commit is contained in:
uwaa 2025-01-06 23:58:05 +00:00
parent 7a4ead1839
commit 75255633e0

View file

@ -816,7 +816,7 @@ public class PleromaAdmin : Pleroma
})))!;
}
public Task<Status> ChangeScope(StatusID id, bool? sensitive = null, StatusVisibility? visibility = null)
public Task<Status> ChangeScope(StatusID status, bool? sensitive = null, StatusVisibility? visibility = null)
{
MemoryStream mem = new MemoryStream();
@ -843,7 +843,7 @@ public class PleromaAdmin : Pleroma
return Retry<Status>(() =>
{
mem.Position = 0;
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Put, $"/api/v1/pleroma/admin/statuses/{id}");
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Put, $"/api/v1/pleroma/admin/statuses{WebUtility.UrlEncode(status.ID)}");
req.Content = new StreamContent(mem);
req.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
return req;