Skip to content

Commit 5109c99

Browse files
author
Yadan Wei
committed
fix: use bash array for curl form data to preserve header quoting
1 parent 1b03a34 commit 5109c99

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

test/vllm-omni/scripts/vllm_omni_ec2_smoke_test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ curl -sf http://localhost:${PORT}/health || { echo "Health check failed"; exit 1
2828

2929
# Send request directly to the API endpoint
3030
if [ "${CONTENT_TYPE}" = "multipart/form-data" ]; then
31-
# Convert key=value&key2=value2 to -F flags
32-
CURL_ARGS=""
31+
CURL_CMD=(curl -sf -X POST "http://localhost:${PORT}${ROUTE}")
3332
IFS='&' read -ra PAIRS <<< "${REQUEST}"
3433
for pair in "${PAIRS[@]}"; do
35-
CURL_ARGS="${CURL_ARGS} -F ${pair}"
34+
CURL_CMD+=(-F "${pair}")
3635
done
37-
eval curl -sf -X POST "http://localhost:${PORT}${ROUTE}" ${CURL_ARGS} --output /tmp/omni_response --max-time 300
36+
CURL_CMD+=(--output /tmp/omni_response --max-time 300)
37+
"${CURL_CMD[@]}"
3838
else
3939
curl -sf -X POST "http://localhost:${PORT}${ROUTE}" \
4040
-H "Content-Type: application/json" \

test/vllm-omni/scripts/vllm_omni_sagemaker_smoke_test.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ curl -sf http://localhost:${PORT}/ping || { echo "Ping failed"; exit 1; }
2828

2929
# Send request via /invocations with route header
3030
if [ "${CONTENT_TYPE}" = "multipart/form-data" ]; then
31-
CURL_ARGS=""
31+
CURL_CMD=(curl -sf -X POST "http://localhost:${PORT}/invocations"
32+
-H "X-Amzn-SageMaker-Custom-Attributes: route=${ROUTE}")
3233
IFS='&' read -ra PAIRS <<< "${REQUEST}"
3334
for pair in "${PAIRS[@]}"; do
34-
CURL_ARGS="${CURL_ARGS} -F ${pair}"
35+
CURL_CMD+=(-F "${pair}")
3536
done
36-
eval curl -sf -X POST "http://localhost:${PORT}/invocations" \
37-
-H "X-Amzn-SageMaker-Custom-Attributes: route=${ROUTE}" \
38-
${CURL_ARGS} --output /tmp/omni_response --max-time 300
37+
CURL_CMD+=(--output /tmp/omni_response --max-time 300)
38+
"${CURL_CMD[@]}"
3939
else
4040
curl -sf -X POST http://localhost:${PORT}/invocations \
4141
-H "Content-Type: application/json" \

0 commit comments

Comments
 (0)