Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hide version number
#1
I need to hide the version number in the html.

<meta Name="GENERATOR" content="IntraWeb v15.2.6 Serial 123124">

I think there is a property on servercontroller to do this.   Does anyone know what it is?
Reply
#2
TIWServerController OnMetaTag:

Code:
//---------------------------------------------------------------------------
void __fastcall TIWServerController::IWServerControllerBaseMetaTag(TIWApplication *ASession, const UnicodeString AMetaName, UnicodeString &vMetaValue)
{
  if(AMetaName == "generator") { vMetaValue = ""; }
}
//---------------------------------------------------------------------------
Reply
#3
(07-29-2020, 07:11 AM)MJS@mjs.us Wrote: TIWServerController OnMetaTag:

Code:
//---------------------------------------------------------------------------
void __fastcall TIWServerController::IWServerControllerBaseMetaTag(TIWApplication *ASession, const UnicodeString AMetaName, UnicodeString &vMetaValue)
{
  if(AMetaName == "generator") { vMetaValue = ""; }
}
//---------------------------------------------------------------------------
Doesn't work!!
Reply
#4
(07-29-2020, 09:50 AM)Comograma Wrote:
(07-29-2020, 07:11 AM)MJS@mjs.us Wrote: TIWServerController OnMetaTag:

Code:
//---------------------------------------------------------------------------
void __fastcall TIWServerController::IWServerControllerBaseMetaTag(TIWApplication *ASession, const UnicodeString AMetaName, UnicodeString &vMetaValue)
{
  if(AMetaName == "generator") { vMetaValue = ""; }
}
//---------------------------------------------------------------------------
Doesn't work!!

Did a quick check... works for me.
Reply
#5
In Delphi, as others have posted, use the OnMetaTag event in Servercontroller:


Code:
procedure TBSIServerController.IWServerControllerBaseMetaTag(
  ASession: TIWApplication; const AMetaName: string; var vMetaValue: string);
begin
    if AMetaName='generator' then
      begin 
        vMetaValue := 'My New Stuff';
      end;
end;


Dan
Reply
#6
(07-29-2020, 09:08 PM)DanBarclay Wrote: In Delphi, as others have posted, use the OnMetaTag event in Servercontroller:


Code:
procedure TBSIServerController.IWServerControllerBaseMetaTag(
  ASession: TIWApplication; const AMetaName: string; var vMetaValue: string);
begin
    if AMetaName='generator' then
      begin 
        vMetaValue := 'My New Stuff';
      end;
end;
Doesn't work. I even try to do a trace with the debugger but it doesn't even reachs there.

Dan
Reply
#7
(07-31-2020, 11:19 AM)Comograma Wrote:
(07-29-2020, 09:08 PM)DanBarclay Wrote: In Delphi, as others have posted, use the OnMetaTag event in Servercontroller:


Code:
procedure TBSIServerController.IWServerControllerBaseMetaTag(
  ASession: TIWApplication; const AMetaName: string; var vMetaValue: string);
begin
    if AMetaName='generator' then
      begin 
        vMetaValue := 'My New Stuff';
      end;
end;
Doesn't work. I even try to do a trace with the debugger but it doesn't even reachs there.

Dan

It works for me without issues.

Thanks everyone.
Reply
#8
(07-31-2020, 11:19 AM)Comograma Wrote:
(07-29-2020, 09:08 PM)DanBarclay Wrote: In Delphi, as others have posted, use the OnMetaTag event in Servercontroller:


Code:
procedure TBSIServerController.IWServerControllerBaseMetaTag(
  ASession: TIWApplication; const AMetaName: string; var vMetaValue: string);
begin
    if AMetaName='generator' then
      begin 
        vMetaValue := 'My New Stuff';
      end;
end;
Doesn't work. I even try to do a trace with the debugger but it doesn't even reachs there.

This should work fine for you in current releases.  What is your IW version?   As I recall this was added in one of the 15.x releases, but you can check the release blogs to be sure.   Does your ServerController list an OnMetaTag event?

Dan
Reply
#9
(07-31-2020, 11:19 AM)Comograma Wrote: Doesn't work. I even try to do a trace with the debugger but it doesn't even reachs there.

I tested on your demo project and it works fine.

Have in mind that it only works in IntraWeb Ultimate licenses...
Reply
#10
(07-29-2020, 01:36 AM)joel Wrote: I need to hide the version number in the html.

<meta Name="GENERATOR" content="IntraWeb v15.2.6 Serial 123124">

I think there is a property on servercontroller to do this.   Does anyone know what it is?
Use:
Code:
procedure TIWServerController.IWServerControllerBaseMetaTag(
  ASession: TIWApplication; const AMetaName: string; var vMetaValue: string);
begin
if AMetaName = 'GENERATOR' then vMetaValue := '';
end;
or for the future:
Code:
procedure TIWServerController.IWServerControllerBaseMetaTag(
  ASession: TIWApplication; const AMetaName: string; var vMetaValue: string);
begin
if AnsiLowerCase(AMetaName) = 'generator' then vMetaValue := '';
end;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)