Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
姜枫
2017-03-13 21:19:40 +0800
Commit
8e2114e755f13bd971de5ec04421170aa4bc2746
2 parents
e7cde9e7
4cc3b877
Merge branch 'feature/anti-spider' into 'master'
fix remote ip See merge request
!96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
doraemon/middleware/limiter/index.js
doraemon/middleware/limiter/index.js
View file @
8e2114e
...
...
@@ -20,7 +20,7 @@ const limiter = (rule, policy, context) => {
};
module
.
exports
=
(
req
,
res
,
next
)
=>
{
let
remoteIp
=
req
.
get
(
'X-Forwarded-For'
);
let
remoteIp
=
req
.
get
(
'X-Forwarded-For'
)
||
req
.
get
(
'X-Real-IP'
)
||
''
;
if
(
remoteIp
.
indexOf
(
','
)
>
0
)
{
let
arr
=
remoteIp
.
split
(
','
);
...
...
Please
register
or
login
to post a comment