We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
有些情况下,用户可能会先设置请求参数编码,再获取参数,比如这段代码:
request.setCharacterEncoding("utf-8"); String xss = request.getParameter("xss");
当某个JS检测插件调用了 context.parameter 去获取参数,就会导致 Java 以默认的 ISO-8859-1 编码去解码,并缓存这个解码结果
context.parameter
ISO-8859-1
之后应用如果调用 request.setCharacterEncoding 将不会产生任何效果,使用 request.getParameter 获取的值也只会是之前缓存过的、解码错误的数据
request.setCharacterEncoding
request.getParameter
解决方案
The text was updated successfully, but these errors were encountered:
选择方案3,并更新了beta文档 #86
Sorry, something went wrong.
No branches or pull requests
有些情况下,用户可能会先设置请求参数编码,再获取参数,比如这段代码:
当某个JS检测插件调用了
context.parameter
去获取参数,就会导致 Java 以默认的ISO-8859-1
编码去解码,并缓存这个解码结果之后应用如果调用
request.setCharacterEncoding
将不会产生任何效果,使用request.getParameter
获取的值也只会是之前缓存过的、解码错误的数据解决方案
request.setCharacterEncoding
函数,当用户调用这个函数,就修改缓存里的数据,重新编码request.getParameter
函数,当用户调用过之后,context.parameter
才返回数据;否则返回空哈希The text was updated successfully, but these errors were encountered: