Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
03f09aad
Commit
03f09aad
authored
Jun 19, 2024
by
王炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整cookies中userid为HttpOnly预防篡改,针对动态页面&静态页面使用系统通用授权查询增加预防sql注入。本需求暂无需上线,仅做git留档
parent
d0c76c47
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
346 additions
and
0 deletions
+346
-0
DefaultLoginAdaptor.java
...n/java/com/hand/hap/adaptor/impl/DefaultLoginAdaptor.java
+3
-0
AbstractFacadeServlet.java
src/main/java/leaf/service/http/AbstractFacadeServlet.java
+343
-0
No files found.
src/main/java/com/hand/hap/adaptor/impl/DefaultLoginAdaptor.java
View file @
03f09aad
...
@@ -57,6 +57,8 @@ public class DefaultLoginAdaptor implements ILoginAdaptor {
...
@@ -57,6 +57,8 @@ public class DefaultLoginAdaptor implements ILoginAdaptor {
private
static
final
boolean
VALIDATE_CAPTCHA
=
true
;
private
static
final
boolean
VALIDATE_CAPTCHA
=
true
;
private
static
final
boolean
COOKIES_HTTP_ONLY
=
true
;
// 校验码
// 校验码
private
static
final
String
KEY_VERIFICODE
=
"verifiCode"
;
private
static
final
String
KEY_VERIFICODE
=
"verifiCode"
;
...
@@ -519,6 +521,7 @@ public class DefaultLoginAdaptor implements ILoginAdaptor {
...
@@ -519,6 +521,7 @@ public class DefaultLoginAdaptor implements ILoginAdaptor {
Cookie
cookie
=
new
Cookie
(
cookieName
,
cookieValue
);
Cookie
cookie
=
new
Cookie
(
cookieName
,
cookieValue
);
cookie
.
setPath
(
StringUtils
.
defaultIfEmpty
(
request
.
getContextPath
(),
"/"
));
cookie
.
setPath
(
StringUtils
.
defaultIfEmpty
(
request
.
getContextPath
(),
"/"
));
cookie
.
setMaxAge
(-
1
);
cookie
.
setMaxAge
(-
1
);
cookie
.
setHttpOnly
(
COOKIES_HTTP_ONLY
);
response
.
addCookie
(
cookie
);
response
.
addCookie
(
cookie
);
}
}
...
...
src/main/java/leaf/service/http/AbstractFacadeServlet.java
0 → 100644
View file @
03f09aad
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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