HXSecurity / DongTai-agent-java

Java Agent is a Java application probe of DongTai IAST, which collects method invocation data during runtime of Java application by dynamic hooks.

Home Page:https://dongtai.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When using resttemplate to customize the header, some fields will not be loaded, such as the host header.

langligelang opened this issue · comments

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.
  • I am not looking for support or already pursued the available support channels without success.

Version

1.1.2

Installation Type

Official Docker Compose

Service Name

DongTai-agent-java

Describe the details of the bug and the steps to reproduce it

When using resttemplate to customize the header, some fields will not be loaded, such as the host header.In sun.net.www.protocol.http.httpurlconnection, allowrestrictedheaders is assigned in the static block and will be initialized only once. In the agent, httpurlconnection is loaded before the program, which leads to this problem.
使用RestTemplate自定义头的时候有些字段会加载不进来,比如说host头。因为在sun.net.www.protocol.http.HttpURLConnection中allowRestrictedHeaders是放在static块中赋值,只会初始化一次。而在agent中先于程序加载了HttpURLConnection,所以导致这个问题。

Additional Information

No response

Logs

No response