[release] v0.10.0-unstable25
This commit is contained in:
parent
a9f83a37b4
commit
e0bf591081
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.10.0-unstable24",
|
"version": "0.10.0-unstable25",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -301,8 +301,12 @@ func Restrictions(RestrictToConstellation bool, WhitelistInboundIPs []string) fu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isInConstellationBlocking := !RestrictToConstellation || isInConstellation
|
||||||
|
isWhitelistBlocking := !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 (RestrictToConstellation && !isInConstellation && (!isUsingWhiteList || !isInWhitelist)) || (!RestrictToConstellation && (!isUsingWhiteList || !isInWhitelist)) {
|
if (isInConstellationBlocking && isWhitelistBlocking) {
|
||||||
|
utils.Log("Request from " + ip + " is blocked because of restrictions isInConstellationBlocking: " + fmt.Sprintf("%v", isInConstellationBlocking) + " and isWhitelistBlocking: " + fmt.Sprintf("%v", isWhitelistBlocking)
|
||||||
http.Error(w, "Access denied", http.StatusForbidden)
|
http.Error(w, "Access denied", http.StatusForbidden)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue