Skip to content

Commit

Permalink
should not request resources from proxy itself
Browse files Browse the repository at this point in the history
  • Loading branch information
netptop committed Mar 12, 2020
1 parent 86b0288 commit c765c03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ let Proxy = ({urlModify, httpprefix, serverName, port, cookieDomainRewrite, loca
let fwdStr = req.headers['X-Forwarded-For'] || req.headers['x-forwarded-for']

let {host, httpType} = getHostFromReq(req)
if (host == '' || host.indexOf('.') === -1 || (fwdStr && fwdStr.split(',').length > 3)) { // too many forwardings
if (host.indexOf(serverName) !== -1 || // we cannot request resource from proxy itself
host == '' || host.indexOf('.') === -1 || (fwdStr && fwdStr.split(',').length > 3)) { // too many forwardings
res.status(404).send("{}")
return
}
Expand Down

0 comments on commit c765c03

Please sign in to comment.