Skip to content

Commit

Permalink
https://github.com/danieleteti/delphimvcframework/issues/701
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Oct 6, 2023
1 parent 7cb33e8 commit eb3d269
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sources/MVCFramework.pas
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ MVCFromCookieAttribute = class(MVCInjectableParamAttribute)

end;

MVCFromContentFieldAttribute = class(MVCInjectableParamAttribute)

end;

// test
// TMVCHackHTTPAppRequest = class(TIdHTTPAppRequest)
// private
Expand Down Expand Up @@ -2931,6 +2935,7 @@ procedure TMVCEngine.FillActualParamsForAction(const ASelectedController: TMVCCo
lStrValue: string;
lFromBodyAttribute: MVCFromBodyAttribute;
lFromQueryStringAttribute: MVCFromQueryStringAttribute;
lFromContentFieldAttribute: MVCFromContentFieldAttribute;
lFromHeaderAttribute: MVCFromHeaderAttribute;
lFromCookieAttribute: MVCFromCookieAttribute;
lAttributeInjectedParamCount: Integer;
Expand Down Expand Up @@ -2982,6 +2987,14 @@ procedure TMVCEngine.FillActualParamsForAction(const ASelectedController: TMVCCo
HandleDefaultValueForInjectedParameter(lInjectedParamValue, lFromQueryStringAttribute);
AActualParams[I] := GetActualParam(AActionFormalParams[I], lInjectedParamValue);
end
else if TRttiUtils.HasAttribute<MVCFromContentFieldAttribute>(AActionFormalParams[I],
lFromContentFieldAttribute) then
begin
Inc(lAttributeInjectedParamCount, 1);
lInjectedParamValue := AContext.Request.ContentParam(lFromContentFieldAttribute.ParamName);
HandleDefaultValueForInjectedParameter(lInjectedParamValue, lFromContentFieldAttribute);
AActualParams[I] := GetActualParam(AActionFormalParams[I], lInjectedParamValue);
end
else if TRttiUtils.HasAttribute<MVCFromHeaderAttribute>(AActionFormalParams[I],
lFromHeaderAttribute) then
begin
Expand Down

0 comments on commit eb3d269

Please sign in to comment.