首页 > 其他分享 >彻底取消unigui的/server页面及扩展应用(78)

彻底取消unigui的/server页面及扩展应用(78)

时间:2024-01-02 11:05:24浏览次数:27  
标签:ToLower unigui ARequestInfo URI server AResponseInfo copy 78


unigui的应用默认会在/server显示相关信息,unigui编译的应用能不能简单设置就可以取消/server页面?

经验证,在UniServerModule.UniGUIServerModuleHTTPCommand拦截/server就可以取消server页面:

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
  var Handled: Boolean);
begin
  if ARequestInfo.URI.ToLower='/server' then
    begin
       Handled := true;
       AResponseInfo.ResponseNo:=405;
       AResponseInfo.CloseConnection:=true;
       AResponseInfo.ContentText :='Access denied';
       AResponseInfo.CloseSession;
       exit;
    end;
end;

拦截处理前:

彻底取消unigui的/server页面及扩展应用(78)_Access

 拦截处理后:

彻底取消unigui的/server页面及扩展应用(78)_Boo_02

 另外:可以扩展为拦截指定路径,提高服务端的安全性。

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(ARequestInfo: TIdHTTPRequestInfo;
  AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean);
begin
    if (length(ARequestInfo.URI)>1) and //放行指定的白名单
    (copy(ARequestInfo.URI.ToLower,1,4)<>'/ext') and //放行指定的白名单
    (copy(ARequestInfo.URI.ToLower,1,4)<>'/uni') and //放行指定的白名单
    (copy(ARequestInfo.URI.ToLower,1,7)<>'/handle') and //放行指定的白名单
    (copy(ARequestInfo.URI.ToLower,1,6)<>'/cache') and //放行指定的白名单
    (copy(ARequestInfo.URI.ToLower,1,2)<>'/m') then //放行指定的白名单
{
    if (copy(ARequestInfo.URI.ToLower,1,7)='/server') or //拦截/server
    (copy(ARequestInfo.URI.ToLower,1,2)='/ui') or //拦截/ui
    (copy(ARequestInfo.URI.ToLower,1,6)='/files') or //拦截/files
    (copy(ARequestInfo.URI.ToLower,1,13)='/uploadfolder') then //拦截/uploadfolder
}
    begin
      Handled := true;
      AResponseInfo.ResponseNo:=405;
      AResponseInfo.CloseConnection:=true;
      AResponseInfo.ContentText :='Access denied';// '<h1>Access denied</h1>';
      AResponseInfo.CloseSession;
      exit;
    end;
end;

 

标签:ToLower,unigui,ARequestInfo,URI,server,AResponseInfo,copy,78
From: https://blog.51cto.com/u_15216366/9064759

相关文章

  • Proxmox Backup Server(PBS)从2.X升级到PBS3
    作者:田逸(formyz)2023年11月31日,Proxmox官方正式发布ProxmoxBackupServer3.1版本。现在我负责管理的ProxmoxBackupServer(以下简称PBS)版本号为2.3,打算将部分PBS升级到PBS3.1,体验一下新版本的新特性。PBS2.3要升级到PBS3.1,至少需要满足两个前提条件:PBS版本升级的2.4和操作系......
  • 删除vCenter上的插件和扩展(Client Plug-Ins & vCenter Server Extensions)
    删除vCenter上的插件和扩展(ClientPlug-Ins&vCenterServerExtensions)删除vSphere界面扩展插件vSphereClient-Administration-ClientPlug-Ins列出了插件状态。1.使用root账号SSH登录到vCSA服务器2.切换目录:-ForvCenterServer6.x,switchtothecd/etc/vmwar......
  • TLS SNI(TLS Server Name Indication)配置:F5、Nginx和IIS
    TLSServerNameIndication(TLSSNI)TLSServerNameIndication(TLSSNI),usedwhenasinglevirtualIPserverneedstohostmultipledomains.TLSSNISupport即一个IP地址上支持多个域名的SSL站点,或者说一个IP上支持绑定多个SSL证书。支持TLSSNI的浏览器Brows......
  • Windows Server 系统中使用 Docker
    资料:WindowsServerInstallationGuideWindowsServer系统是支持Docker的。然而,需要注意的是,并非所有的WindowsServer版本都支持Docker。以下是支持运行Docker的WindowsServer版本:WindowsServer2016(需要安装DockerforWindows)WindowsServer2019(需要安装D......
  • MAC下载MySQL5.7:Can't connect to local MySQL server through socket '/tmp/mysql.so
    1.错误描述错误截图如下所示:3.扩展MySQL服务启动、关闭、重启命令:启动MySQL服务:sudo/usr/local/mysql/support-files/mysql.serverstart停止MySQL服务:sudo/usr/local/mysql/support-files/mysql.serverstop重启MySQL服务:sudo/usr/local/mysql/support-files/mysql.serverr......
  • check the manual that corresponds to your MySQL server version for the right syn
    form:{repairstatus:0,name:'',//负责人maintenancetime:newDate().toISOString().split('T')[0],//保修时间equipmentid:'',equipment:'',describe:'',finfishtime:'',repairname:'�......
  • kube-apiserver开启审计
    k8sv1.19.0#/etc/kubernetes/pki/audit-policy.yamlapiVersion:audit.k8s.io/v1beta1kind:Policyrules:-level:Requestresources:-group:""-level:RequestResponseresources:-group:""-level:Metadatares......
  • openGauss学习笔记-178 openGauss 数据库运维-逻辑复制-逻辑解码-使用SQL函数接口进行
    openGauss学习笔记-178openGauss数据库运维-逻辑复制-逻辑解码-使用SQL函数接口进行逻辑解码openGauss可以通过调用SQL函数,进行创建、删除、推进逻辑复制槽,获取解码后的事务日志。178.1前提条件逻辑日志目前从主机节点中抽取,默认关闭SSL连接,如果进行逻辑复制,需要先配置GUC......
  • 高可靠性的F2915NBGK8、F2914NBGK8射频开关,MAAL-011078-001SMB具有超低噪声系数的射频
    1、F2915NBGK8 高可靠性SP5T射频开关 8GHZ24VFQFPNF2915是一款高可靠性、低插入损耗、50ΩSP5T吸收式射频开关,专为各种无线和其他射频应用而设计。该器件覆盖50MHz至8000MHz的宽频率范围。除了提供低插入损耗外,F2915还提供出色的线性度和隔离性能,同时为未使用的RF端口提供50......
  • Ubuntu系统安装与配置VNC server实现远程桌面连接
    本文介绍了在Ubuntu系统上安装和配置VNC服务器所需的步骤,并展示在windows端如何通过SSH隧道安全地连接到VNC服务器。本文测试环境Ubuntu版本18.04,其它版本也行。整个安装过程只需要两条命令,再简单配置一下就能搞定。1、ubuntu系统先连接好互联网2、第一条命令sudoapti......