fix: validate app name in app-scoped commands
This commit is contained in:
@@ -37,7 +37,7 @@ validate_nginx() {
|
||||
verify_app_name "$APP"
|
||||
nginx_vhosts_validate_single_func "$APP" "$FLAG"
|
||||
else
|
||||
for app in $(dokku_apps "false"); do
|
||||
for app in $(dokku_apps); do
|
||||
nginx_vhosts_validate_single_func "$app" "$FLAG"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -18,13 +18,12 @@ cmd-nginx-set() {
|
||||
dokku_log_fail "Invalid key specified, valid keys include: access-log-format, access-log-path, bind-address-ipv4, bind-address-ipv6, client-body-timeout, client-header-timeout, client-max-body-size, disable-custom-config, error-log-path, hsts, hsts-include-subdomains, hsts-preload, hsts-max-age, keepalive-timeout, lingering-timeout, nginx-conf-sigil-path, nginx-service-command, proxy-buffer-size, proxy-buffering, proxy-buffers, proxy-busy-buffers-size, proxy-connect-timeout, proxy-read-timeout, proxy-send-timeout, proxy-keepalive, send-timeout, underscore-in-headers, x-forwarded-for-value, x-forwarded-port-value, x-forwarded-proto-value, x-forwarded-ssl"
|
||||
fi
|
||||
|
||||
if ! fn-in-array "$KEY" "${GLOBAL_KEYS[@]}"; then
|
||||
if [[ "$APP" == "--global" ]]; then
|
||||
dokku_log_fail "The key '$KEY' cannot be set globally"
|
||||
fi
|
||||
verify_app_name "$APP"
|
||||
if ! fn-in-array "$KEY" "${GLOBAL_KEYS[@]}" && [[ "$APP" == "--global" ]]; then
|
||||
dokku_log_fail "The key '$KEY' cannot be set globally"
|
||||
fi
|
||||
|
||||
[[ "$APP" == "--global" ]] || verify_app_name "$APP"
|
||||
|
||||
if [[ "$KEY" == "proxy-keepalive" ]] && [[ -n "$VALUE" ]]; then
|
||||
if ! is_number "$VALUE"; then
|
||||
dokku_log_fail "Invalid value for proxy-keepalive: must be an integer"
|
||||
|
||||
Reference in New Issue
Block a user