mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Web server - JSON and string inputs also accept PUT
This commit is contained in:
1 parent
4f7e35d167
commit
c4b18b699d
2 files changed
+5
-5
No files matched your search
@@ -43,9 +43,9 @@ namespace Artemis.Core.Services
|
||||
/// <inheritdoc />
|
||||
protected override async Task ProcessRequest(IHttpContext context)
|
||||
{
|
||||
if (context.Request.HttpVerb != HttpVerbs.Post)
|
||||
throw HttpException.MethodNotAllowed("This end point only accepts POST calls");
|
||||
|
||||
if (context.Request.HttpVerb != HttpVerbs.Post && context.Request.HttpVerb != HttpVerbs.Put)
|
||||
throw HttpException.MethodNotAllowed("This end point only accepts POST and PUT calls");
|
||||
|
||||
context.Response.ContentType = MimeType.Json;
|
||||
|
||||
using TextReader reader = context.OpenRequestText();
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace Artemis.Core.Services
|
||||
/// <inheritdoc />
|
||||
protected override async Task ProcessRequest(IHttpContext context)
|
||||
{
|
||||
if (context.Request.HttpVerb != HttpVerbs.Post)
|
||||
throw HttpException.MethodNotAllowed("This end point only accepts POST calls");
|
||||
if (context.Request.HttpVerb != HttpVerbs.Post && context.Request.HttpVerb != HttpVerbs.Put)
|
||||
throw HttpException.MethodNotAllowed("This end point only accepts POST and PUT calls");
|
||||
|
||||
context.Response.ContentType = MimeType.PlainText;
|
||||
|
||||
|
||||
Reference in new issue
Block a user