How can I change request body in java filter to protect from XSS
attack?
I build HttpServletRequestWrapper
and use getparameter
for change body but
get stream close exception.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Since I do not have enough reputation to add a comment, I am adding it as an answer. After 3 years, I found the accepted answer to save me hours. At the same time, I had to fix couple of things, and hence adding...
(1) A bug (missing assignment to rawData)
(2) A change necessitated over time. Reference: https://stackoverflow.com/questions/29208456/httpservletrequestwrapper-example-implementation-for-setreadlistener-isfinish
XSSFilter.java
XSSRequestWrapper .java
XSSUtils .java