提交 252ba52b 作者: 李星宇

安全增加,验证X-API-Key

上级 c34b7080
...@@ -49,7 +49,7 @@ function handle { ...@@ -49,7 +49,7 @@ function handle {
}" }"
# 执行 curl 请求,并将响应结果存储在 response 变量中 # 执行 curl 请求,并将响应结果存储在 response 变量中
response=$(curl -s -X POST -H "Content-Type: application/json" -d "$json_data" "http://$internal_ip:10080/start-container") response=$(curl -s -X POST -H "Content-Type: application/json" -H "X-API-Key: uOyKfp20pdM3MFhr3KAQBoe1UHCaZLUeeLephB57MPvGXTY05Eis5eaxta6fEtpa" -d "$json_data" "http://$internal_ip:10080/start-container")
echo "响应结果: ${response}" echo "响应结果: ${response}"
# 检查响应中是否包含 "succeed" # 检查响应中是否包含 "succeed"
if echo "$response" | grep -q "successfully"; then if echo "$response" | grep -q "successfully"; then
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论