Skip to content

Commit ca8e59a

Browse files
author
Gabriel Fernandes
committed
Remove empty response code validation
1 parent e895b6b commit ca8e59a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

php-fpm-healthcheck

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
# 4 - One or more required softwares are missing
2525
# 8 - Couldn't reach PHP fpm status page, have you configured it with `pm.status_path = /status`?
2626
# 9 - Couldn't connect to PHP fpm, is it running?
27-
# 10 - Malformed PHP fpm status page
2827
# 111 - Couldn't connect to PHP fpm, is it running?
2928
#
3029
# Available options:
@@ -58,12 +57,7 @@ get_fpm_status() {
5857
if test "$VERBOSE" = 1; then printf "Trying to connect to PHP-FPM via: %s%s\\n" "$1" "$SCRIPT_NAME"; fi;
5958

6059
FPM_STATUS=$(env -i REQUEST_METHOD="$REQUEST_METHOD" SCRIPT_NAME="$SCRIPT_NAME" SCRIPT_FILENAME="$SCRIPT_FILENAME" "$FCGI_CMD_PATH" -bind -connect "$1" 2> /dev/null)
61-
62-
RESPONSE_CODE=$(echo "$FPM_STATUS" | grep -o -E "^Status:\s*\d{3}" | sed 's/[^0-9]*//g')
63-
if ! test "$RESPONSE_CODE" -eq "$RESPONSE_CODE" 2> /dev/null; then
64-
>&2 echo "Malformed PHP-FPM status page. Aborting.";
65-
exit 10;
66-
fi
60+
RESPONSE_CODE=$(echo "$FPM_STATUS" | grep "^Status:" | sed 's/[^0-9]*//g')
6761

6862
if test "$RESPONSE_CODE" -lt 200 -o "$RESPONSE_CODE" -ge 400; then
6963
>&2 printf "Unable to reach PHP-FPM status page. Response code: %s\\n" "$RESPONSE_CODE";

0 commit comments

Comments
 (0)