[release] v0.10.0-unstable26
This commit is contained in:
parent
b57969fd6d
commit
443f584cb3
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.10.0-unstable25",
|
"version": "0.10.0-unstable26",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -301,12 +301,12 @@ func Restrictions(RestrictToConstellation bool, WhitelistInboundIPs []string) fu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isInConstellationBlocking := !RestrictToConstellation || isInConstellation
|
isInConstellationPassing := !RestrictToConstellation || isInConstellation
|
||||||
isWhitelistBlocking := !isUsingWhiteList || isInWhitelist
|
isWhitelistPassing := !isUsingWhiteList || isInWhitelist
|
||||||
|
|
||||||
// check if the request is coming from the constellation IP range 192.168.201.0/24
|
// check if the request is coming from the constellation IP range 192.168.201.0/24
|
||||||
if (isInConstellationBlocking && isWhitelistBlocking) {
|
if (!isInConstellationPassing || !isWhitelistPassing) {
|
||||||
Log("Request from " + ip + " is blocked because of restrictions isInConstellationBlocking: " + fmt.Sprintf("%v", isInConstellationBlocking) + " and isWhitelistBlocking: " + fmt.Sprintf("%v", isWhitelistBlocking))
|
Log("Request from " + ip + " is blocked because of restrictions isInConstellationPassing: " + fmt.Sprintf("%v", isInConstellationPassing) + " and isWhitelistPassing: " + fmt.Sprintf("%v", isWhitelistPassing))
|
||||||
http.Error(w, "Access denied", http.StatusForbidden)
|
http.Error(w, "Access denied", http.StatusForbidden)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue