Skip to content

Commit

Permalink
Bug lazarus
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez committed Jan 13, 2021
1 parent 93155ef commit bdd4172
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions samples/lazarus/boss-lock.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"hash": "d41d8cd98f00b204e9800998ecf8427e",
"updated": "2020-11-04T21:25:53.8317735-03:00",
"hash": "a4a6a33a3c5fb414fef69b653c591e0a",
"updated": "2021-01-13T10:38:00.9794777-03:00",
"installedModules": {
"github.com/hashload/horse": {
"name": "horse",
"version": "v2.0.3",
"hash": "fb7144725ff788c49af1307f97f23b5a",
"version": "2.0.8",
"hash": "f0d9be7d8b5059a6e99397562d39306c",
"artifacts": {},
"failed": false,
"changed": false
Expand Down
2 changes: 1 addition & 1 deletion samples/lazarus/boss.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"mainsrc": "./",
"projects": [],
"dependencies": {
"github.com/hashload/horse": "^v2.0.3"
"github.com/hashload/horse": "^v2.0.8"
}
}
4 changes: 2 additions & 2 deletions 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 ({$IF DEFINED(FPC)} StringCommandToMethodType(LWebRequest.Method)
if ({$IF DEFINED(FPC)} StringCommandToMethodType(Req.RawWebRequest.Method)
{$ELSE} Req.RawWebRequest.MethodType{$ENDIF} in [mtPost, mtPut]) and (Req.RawWebRequest.ContentType = 'application/json') then
begin
LJSON := {$IF DEFINED(FPC)} GetJSON(Req.Body) {$ELSE}TJSONObject.ParseJSONValue(Req.Body){$ENDIF};
Expand All @@ -51,7 +51,7 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINED
if (Res.Content <> nil) and Res.Content.InheritsFrom({$IF DEFINED(FPC)}TJsonData{$ELSE}TJSONValue{$ENDIF}) then
begin
{$IF DEFINED(FPC)}
LWebResponse.ContentStream := TStringStream.Create(TJsonData(LContent).AsJSON);
Res.RawWebResponse.ContentStream := TStringStream.Create(TJsonData(Res.Content).AsJSON);
{$ELSE}
Res.RawWebResponse.Content := {$IF CompilerVersion > 27.0}TJSONValue(Res.Content).ToJSON{$ELSE}TJSONValue(LContent).ToString{$ENDIF};
{$ENDIF}
Expand Down

0 comments on commit bdd4172

Please sign in to comment.