Mark /Api/WWW/Send as obsolete

This commit is contained in:
JustArchi
2021-03-08 22:33:26 +01:00
parent a4310d28f7
commit 0e29aaf20f

View File

@@ -136,6 +136,7 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
/// </remarks>
[Consumes("application/json")]
[HttpPost("Send")]
[Obsolete("ASF-ui should switch to new /Api/WWW/Github/{Release|Wiki} endpoints.")]
[ProducesResponseType(typeof(GenericResponse<string>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.ServiceUnavailable)]
@@ -148,6 +149,8 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
throw new InvalidOperationException(nameof(ASF.WebBrowser));
}
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningDeprecated, nameof(SendPost), nameof(GitHubReleaseGet) + "/" + nameof(GitHubWikiHistoryGet) + "/" + nameof(GitHubWikiPageGet)));
if (string.IsNullOrEmpty(request.URL) || !Uri.TryCreate(request.URL, UriKind.Absolute, out Uri? uri) || !uri.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)) {
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(request.URL))));
}