When the frontend passes parameters to the backend, the special characters (+, -) tags

When the frontend passes parameters to the backend, the special character (+, -) tags <p> and <span> are lost. The reason is that the XSS or other interceptors in the system backend filter the script language. For this kind of problem, The situation can be bypassed by using hex encoding

1. The previous page encrypts the transmitted data.


Encrypted data = encodeURIComponent(Cert);


2. Analyze the data passed from the previous section in the background


java Reference   import java.net.URLDecoder;


Decrypted data = URLDecoder.decode(Cert,"UTF-8");
 

Guess you like

Origin blog.csdn.net/zhaofuqiangmycomm/article/details/132731483