Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
0a893d19
Unverified
Commit
0a893d19
authored
Jul 05, 2022
by
疯狂的狮子Li
Committed by
Gitee
Jul 05, 2022
Browse files
update 优化魔法值
parent
6f48fc3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
View file @
0a893d19
...
...
@@ -10,6 +10,7 @@ import javax.servlet.ServletResponse;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequestWrapper
;
import
com.ruoyi.common.utils.http.HttpHelper
;
import
com.ruoyi.common.constant.Constants
;
/**
* 构建可重复读取inputStream的request
...
...
@@ -23,10 +24,10 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper
public
RepeatedlyRequestWrapper
(
HttpServletRequest
request
,
ServletResponse
response
)
throws
IOException
{
super
(
request
);
request
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
request
.
setCharacterEncoding
(
Constants
.
UTF8
);
response
.
setCharacterEncoding
(
Constants
.
UTF8
);
body
=
HttpHelper
.
getBodyString
(
request
).
getBytes
(
"UTF-8"
);
body
=
HttpHelper
.
getBodyString
(
request
).
getBytes
(
Constants
.
UTF8
);
}
@Override
...
...
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java
View file @
0a893d19
...
...
@@ -12,6 +12,7 @@ import javax.servlet.ServletResponse;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.enums.HttpMethod
;
/**
* 防止XSS攻击的过滤器
...
...
@@ -59,7 +60,7 @@ public class XssFilter implements Filter
String
url
=
request
.
getServletPath
();
String
method
=
request
.
getMethod
();
// GET DELETE 不过滤
if
(
method
==
null
||
m
ethod
.
matches
(
"GET"
)
||
method
.
matches
(
"DELETE"
))
if
(
method
==
null
||
HttpM
ethod
.
GET
.
matches
(
method
)
||
HttpMethod
.
DELETE
.
matches
(
method
))
{
return
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment