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