[release] v0.10.1
This commit is contained in:
parent
112d1aaa99
commit
4166e2d2d1
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.10.1-unstable3",
|
"version": "0.10.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -302,31 +302,23 @@ func Restrictions(RestrictToConstellation bool, WhitelistInboundIPs []string) fu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug("Is using whitelist: " + fmt.Sprintf("%v", isUsingWhiteList))
|
if(RestrictToConstellation) {
|
||||||
Debug("Is in whitelist: " + fmt.Sprintf("%v", isInWhitelist))
|
if(!isInConstellation) {
|
||||||
Debug("Is using constellation: " + fmt.Sprintf("%v", RestrictToConstellation))
|
if(!isUsingWhiteList) {
|
||||||
Debug("Is in constellation: " + fmt.Sprintf("%v", isInConstellation))
|
|
||||||
|
|
||||||
if(RestrictToConstellation) { // true
|
|
||||||
Debug("RestrictToConstellation")
|
|
||||||
if(!isInConstellation) { // true
|
|
||||||
Debug("isInConstellation")
|
|
||||||
if(!isUsingWhiteList) { // false
|
|
||||||
Debug("isUsingWhiteList")
|
|
||||||
Error("Request from " + ip + " is blocked because of restrictions", nil)
|
Error("Request from " + ip + " is blocked because of restrictions", nil)
|
||||||
|
Debug("Blocked by RestrictToConstellation isInConstellation isUsingWhiteList")
|
||||||
http.Error(w, "Access denied", http.StatusForbidden)
|
http.Error(w, "Access denied", http.StatusForbidden)
|
||||||
return
|
return
|
||||||
} else if (!isInWhitelist) { // false
|
} else if (!isInWhitelist) {
|
||||||
Debug("isInWhitelist")
|
|
||||||
Error("Request from " + ip + " is blocked because of restrictions", nil)
|
Error("Request from " + ip + " is blocked because of restrictions", nil)
|
||||||
|
Debug("Blocked by RestrictToConstellation isInConstellation isInWhitelist")
|
||||||
http.Error(w, "Access denied", http.StatusForbidden)
|
http.Error(w, "Access denied", http.StatusForbidden)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(isUsingWhiteList && !isInWhitelist) {
|
} else if(isUsingWhiteList && !isInWhitelist) {
|
||||||
Debug("isUsingWhiteList && !isInWhitelist")
|
|
||||||
Debug("isInWhitelist")
|
|
||||||
Error("Request from " + ip + " is blocked because of restrictions", nil)
|
Error("Request from " + ip + " is blocked because of restrictions", nil)
|
||||||
|
Debug("Blocked by RestrictToConstellation isInConstellation isUsingWhiteList isInWhitelist")
|
||||||
http.Error(w, "Access denied", http.StatusForbidden)
|
http.Error(w, "Access denied", http.StatusForbidden)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue