添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
大力的拐杖  ·  getting error on ...·  7 月前    · 
不敢表白的牛肉面  ·  vue+mapbox-gl-draw ...·  9 月前    · 
微醺的伤痕  ·  Discuz! 防采集字体反爬 ...·  10 月前    · 
纯真的生姜  ·  精准预报强对流天气 ...·  1 年前    · 

Suite webserver is configured with a custom error page, which by default handles errors at the application and context levels. Errors that occur at the server level display default error pages. These pages show the server version and part of the stack trace, which poses a risk.

This article disables the Apache Tomcat server detailed HTTP server responses by adding configuration attributes to the server.xml file. The $CATALINA_BASE/conf/server.xml is the main configuration file. It is divided into several categories such as Top Level Elements , Executors , Connectors , Containers , and Nested Components . These categories contain configuration attributes that let you adjust the Apache Tomcat server’s functionality.

How to prevent a detailed HTTP error response when sending special characters

By default, when special characters such as []/{}\`”> are added to the URL, the Tomcat server returns a 400 response that reveals information about the server, as in the image.

To solve this error, add the following properties to the HTTP Connector element in the server.xml file.

· relaxedPathChars = '[]|{}^\`">'

· relaxedQueryChars='[]|{}^\`">'

For example, enter the following statement in a single line:

<Connector connectionTimeout=”20000” port=”8080” protocol=”HTTP/1.1” redirectPort=”8443” relaxedPathChars='[]|{}^\`">' relaxedQueryChars='[]|{}^\`">'

How to prevent a detailed HTTP error response when sending a long parameter

By default, when a long parameter is sent, the Tomcat server returns a 400 response that reveals information about the server, as in the image.

<Valve className ="org.apache.catalina.valves.ErrorReportValve" showReport ="false" showServerInfo ="false" />

Note: When you disable both showServerInfo and showReport , only the HTTP status code is returned.

ErrorReportValve configuration attributes are described in the following table: