From 06a70f83f87229b7a1cfce842af66c4112868fa5 Mon Sep 17 00:00:00 2001 From: Vinicius Sanchez Date: Mon, 24 Apr 2023 09:28:16 -0300 Subject: [PATCH] #16 --- src/Horse.Jhonson.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Horse.Jhonson.pas b/src/Horse.Jhonson.pas index 6a6b76d..29a9ed0 100644 --- a/src/Horse.Jhonson.pas +++ b/src/Horse.Jhonson.pas @@ -39,7 +39,7 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINED var LJSON: {$IF DEFINED(FPC)}TJsonData{$ELSE}TJSONValue{$ENDIF}; begin - if (Req.MethodType in [mtPost, mtPut, mtPatch]) and (Req.RawWebRequest.ContentType.Contains('application/json')) then + if (Req.MethodType in [mtPost, mtPut, mtPatch]) and (Pos('application/json', Req.RawWebRequest.ContentType) > 0) then begin try LJSON := {$IF DEFINED(FPC)} GetJSON(Req.Body) {$ELSE}TJSONObject.ParseJSONValue(Req.Body){$ENDIF};