Daniele Teti 2023-06-21 12:56:21 +02:00
parent 0374d8fa4b
commit 17d9afc58e
4 changed files with 14 additions and 8 deletions

View File

@ -233,6 +233,7 @@ Congratulations to Daniele Teti and all the staff for the excellent work!" -- Ma
- Added support for dotEnv multiline keys - added dotEnv show case
- 🐞 FIX [Issue 664](https://github.com/danieleteti/delphimvcframework/issues/664) Thanks to [MPannier](https://github.com/MPannier)
- 🐞 FIX [Issue 667](https://github.com/danieleteti/delphimvcframework/issues/667)

View File

@ -0,0 +1 @@
locust --host http://localhost:8080 --autostart -u 200 -r 100

View File

@ -372,7 +372,7 @@ begin
LPassword := TNetEncoding.URL.Decode(AContext.Request.Headers[FPasswordHeaderName]);
// read from content
if LUsername.IsEmpty then
if LUsername.IsEmpty and not SameText(AContext.Request.ContentMediaType, TMVCMediaType.APPLICATION_JSON) then
begin
LUsername := AContext.Request.ContentParam(FUserNameHeaderName);
LPassword := AContext.Request.ContentParam(FPasswordHeaderName);
@ -381,11 +381,7 @@ begin
// read from json content
if LUsername.IsEmpty then
begin
lJObj := nil;
try
lJObj := TJsonBaseObject.Parse(AContext.Request.Body) as TJsonObject;
except
end;
lJObj := StrToJSONObject(AContext.Request.Body, False);
try
if Assigned(lJObj) then
begin

View File

@ -3673,7 +3673,11 @@ begin
on E: Exception do
begin
lJSON.Free;
raise EMVCDeserializationException.Create('Invalid JSON Object - ' + E.Message);
Result := nil;
if ARaiseExceptionOnError then
begin
raise EMVCDeserializationException.Create('Invalid JSON Object - ' + E.Message);
end;
end;
end;
end;
@ -3694,7 +3698,11 @@ begin
on E: Exception do
begin
lJSON.Free;
raise EMVCDeserializationException.Create('Invalid JSON Array - ' + E.Message);
Result := nil;
if ARaiseExceptionOnError then
begin
raise EMVCDeserializationException.Create('Invalid JSON Array - ' + E.Message);
end;
end;
end;
end;