The TMVCWebRequest.GetParams method failed to look for a field in the body's content when there was some url encoding character. Fixed to check body content only if content-type is application/x-www-form-urlencoded

This commit is contained in:
João Antônio Duarte 2020-10-21 16:45:07 -03:00
parent 6bfa63b85a
commit f826315b46

View File

@ -1483,7 +1483,9 @@ function TMVCWebRequest.GetParams(const AParamName: string): string;
begin
if (not Assigned(FParamsTable)) or (not FParamsTable.TryGetValue(AParamName, Result)) then
begin
Result := FWebRequest.ContentFields.Values[AParamName];
Result := '';
if FWebRequest.ContentType = TMVCMediaType.APPLICATION_FORM_URLENCODED then
Result := FWebRequest.ContentFields.Values[AParamName];
if Result.IsEmpty then
Result := FWebRequest.QueryFields.Values[AParamName];
if Result.IsEmpty then