Ignore:
Timestamp:
Sep 9, 2022, 9:41:42 PM (2 years ago)
Author:
chronos
Message:
  • Fixed: Better handle invalid not found pages including correct HTTP code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UWebSession.pas

    r138 r139  
    99
    1010type
     11
    1112  { TWebSession }
    1213
     
    2526    BaseURL: string;
    2627    ModuleManager: TModuleManager;
     28    procedure PageNotFound;
    2729    procedure InitDatabase;
    2830    constructor Create; override;
     
    3840  UCore, UModuleSystem, UModuleZdechovNET, UModuleUser, UPageAdmin, UModuleTV,
    3941  UModuleFinance, UModuleNetwork, UModulePortal, UModuleIS, UModuleBase,
    40   UModuleNews;
     42  UModuleNews, UPageNotFound;
    4143
    4244resourcestring
     
    187189end;
    188190
     191procedure TWebSession.PageNotFound;
     192var
     193  Page: TPageNotFound;
     194begin
     195  Page := TPageNotFound.Create(nil);
     196  try
     197    if Assigned(Page.OnProduce) then
     198      Page.OnProduce(Self);
     199  finally
     200    Page.Free;
     201  end;
     202end;
     203
    189204
    190205end.
Note: See TracChangeset for help on using the changeset viewer.