Skip to content

Commit e21cb2a

Browse files
Grace Bradleyclaude
authored andcommitted
fix(macos): health check curl -f flag breaks 401 detection
curl -sf fails on 401 (auth-protected), causing || echo "000" to append to the HTTP code output ("401" + "000" = "401000"). The subsequent 401 string comparison never matches. Remove -f so curl always returns the HTTP code on any response, and the fallback only fires on connection failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ac0fc3b commit e21cb2a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dream-server/installers/macos/dream-macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ cmd_status() {
239239
local name="${ep_names[$i]}"
240240
local url="${ep_urls[$i]}"
241241
local code
242-
code=$(curl -sf -o /dev/null -w "%{http_code}" "$url" 2>/dev/null || echo "000")
242+
code=$(curl -s -o /dev/null -w "%{http_code}" "$url" 2>/dev/null || echo "000")
243243
if [[ "$code" -ge 200 ]] && [[ "$code" -lt 400 ]]; then
244244
ai_ok "${name}: healthy"
245245
elif [[ "$code" == "401" ]] || [[ "$code" == "403" ]]; then

dream-server/installers/macos/install-macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ for ((idx=0; idx<${#HEALTH_NAMES[@]}; idx++)); do
763763
HEALTHY=false
764764

765765
for ((attempt=1; attempt<=MAX_ATTEMPTS; attempt++)); do
766-
HTTP_CODE=$(curl -sf -o /dev/null -w "%{http_code}" "$URL" 2>/dev/null || echo "000")
766+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL" 2>/dev/null || echo "000")
767767
if [[ "$HTTP_CODE" -ge 200 ]] && [[ "$HTTP_CODE" -lt 400 ]]; then
768768
HEALTHY=true
769769
break

0 commit comments

Comments
 (0)