Skip to content

Commit

Permalink
Delay adding the header X-SPA-MP until the MasterPageObj is instantia…
Browse files Browse the repository at this point in the history
…ted.

Since sendSpaHeaders is called at the start of execution, the MasterPageObj is null at this moment.
  • Loading branch information
claudiamurialdo committed Jun 16, 2023
1 parent 1ce8bd7 commit 8a9872d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions dotnet/src/dotnetframework/GxClasses/Middleware/GXHttp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3004,15 +3004,6 @@ public abstract class GXDataArea : GXHttpHandler

protected GXMasterPage MasterPageObj { get; set; }

protected override void sendSpaHeaders()
{
base.sendSpaHeaders();
if (MasterPageObj != null)
{
localHttpContext.Response.AddHeader(GX_SPA_MASTERPAGE_HEADER, MasterPageObj.GetPgmname());
}
}

protected override void ValidateSpaRequest()
{
string sourceMasterPage = localHttpContext.Request.Headers[GX_SPA_MASTERPAGE_HEADER];
Expand All @@ -3021,6 +3012,10 @@ protected override void ValidateSpaRequest()
context.DisableSpaRequest();
sendSpaHeaders();
}
if (MasterPageObj != null)
{
localHttpContext.Response.Headers[GX_SPA_MASTERPAGE_HEADER] = MasterPageObj.GetPgmname();
}
}
}
public class GXDataAreaControl
Expand Down

0 comments on commit 8a9872d

Please sign in to comment.