mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Web server - JSON and string inputs also accept PUT
This commit is contained in:
parent
4f7e35d167
commit
c4b18b699d
@ -43,9 +43,9 @@ namespace Artemis.Core.Services
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override async Task ProcessRequest(IHttpContext context)
|
protected override async Task ProcessRequest(IHttpContext context)
|
||||||
{
|
{
|
||||||
if (context.Request.HttpVerb != HttpVerbs.Post)
|
if (context.Request.HttpVerb != HttpVerbs.Post && context.Request.HttpVerb != HttpVerbs.Put)
|
||||||
throw HttpException.MethodNotAllowed("This end point only accepts POST calls");
|
throw HttpException.MethodNotAllowed("This end point only accepts POST and PUT calls");
|
||||||
|
|
||||||
context.Response.ContentType = MimeType.Json;
|
context.Response.ContentType = MimeType.Json;
|
||||||
|
|
||||||
using TextReader reader = context.OpenRequestText();
|
using TextReader reader = context.OpenRequestText();
|
||||||
|
|||||||
@ -32,8 +32,8 @@ namespace Artemis.Core.Services
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override async Task ProcessRequest(IHttpContext context)
|
protected override async Task ProcessRequest(IHttpContext context)
|
||||||
{
|
{
|
||||||
if (context.Request.HttpVerb != HttpVerbs.Post)
|
if (context.Request.HttpVerb != HttpVerbs.Post && context.Request.HttpVerb != HttpVerbs.Put)
|
||||||
throw HttpException.MethodNotAllowed("This end point only accepts POST calls");
|
throw HttpException.MethodNotAllowed("This end point only accepts POST and PUT calls");
|
||||||
|
|
||||||
context.Response.ContentType = MimeType.PlainText;
|
context.Response.ContentType = MimeType.PlainText;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user