Skip to content

Commit

Permalink
Fixed ContentType check
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-djsystem committed Jul 27, 2022
1 parent 51c8037 commit 8d6b590
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Horse.Jhonson.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 'application/json') then
if (Req.MethodType in [mtPost, mtPut, mtPatch]) and (Req.RawWebRequest.ContentType.Contains('application/json')) then
begin
try
LJSON := {$IF DEFINED(FPC)} GetJSON(Req.Body) {$ELSE}TJSONObject.ParseJSONValue(Req.Body){$ENDIF};
Expand Down

0 comments on commit 8d6b590

Please sign in to comment.