Skip to content

Commit 62c717b

Browse files
authored
protect against terrible env vars with spaces (#2635)
Co-authored-by: burnettk <[email protected]>
1 parent ae8ad1e commit 62c717b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spiffworkflow-frontend/bin/boot_server_in_docker

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ if [[ -n "$react_configs" ]]; then
2121
exit 1
2222
fi
2323

24-
for react_config in $react_configs; do
24+
while IFS= read -r react_config; do
25+
[[ -z "$react_config" ]] && continue
26+
2527
env_var=$(awk -F '=' '{print $1}' <<<"$react_config" | sed -E 's/^SPIFFWORKFLOW_FRONTEND_RUNTIME_CONFIG_//')
2628
env_value=$(awk -F '=' '{print $2}' <<<"$react_config" | sed -E "s/(^['\"]|['\"]$)//g")
2729

@@ -40,7 +42,7 @@ if [[ -n "$react_configs" ]]; then
4042
echo >&2 "index.html: $(cat $index_html_file)"
4143
exit 1
4244
fi
43-
done
45+
done <<< "$react_configs"
4446
fi
4547

4648
port_to_use="${PORT0:-80}"

0 commit comments

Comments
 (0)