[release] v0.4.0-unstable10
This commit is contained in:
parent
1f97b7bf29
commit
13639a02e1
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.4.0-unstable9",
|
"version": "0.4.0-unstable10",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -16,7 +16,7 @@ func SecureContainerRoute(w http.ResponseWriter, req *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
vars := mux.Vars(req)
|
vars := mux.Vars(req)
|
||||||
containerName := utils.Sanitize(vars["containerId"])
|
containerName := utils.SanitizeSafe(vars["containerId"])
|
||||||
status := utils.Sanitize(vars["status"])
|
status := utils.Sanitize(vars["status"])
|
||||||
|
|
||||||
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
||||||
|
|
|
@ -37,7 +37,7 @@ func UpdateContainerRoute(w http.ResponseWriter, req *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
vars := mux.Vars(req)
|
vars := mux.Vars(req)
|
||||||
containerName := utils.Sanitize(vars["containerId"])
|
containerName := utils.SanitizeSafe(vars["containerId"])
|
||||||
|
|
||||||
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
||||||
utils.Error("SecureContainerRoute - Container cannot update itself", nil)
|
utils.Error("SecureContainerRoute - Container cannot update itself", nil)
|
||||||
|
|
|
@ -220,6 +220,10 @@ func Sanitize(s string) string {
|
||||||
return strings.ToLower(strings.TrimSpace(s))
|
return strings.ToLower(strings.TrimSpace(s))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SanitizeSafe(s string) string {
|
||||||
|
return strings.TrimSpace(s)
|
||||||
|
}
|
||||||
|
|
||||||
func GetConfigFileName() string {
|
func GetConfigFileName() string {
|
||||||
configFile := os.Getenv("CONFIG_FILE")
|
configFile := os.Getenv("CONFIG_FILE")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue