Skip to content

Commit f7cd3cd

Browse files
committed
(PA-7586) Don't assume curl uses HTTP/1.1
The script assumed curl was using HTTP/1.1 as it was tried to match: 404 Not Found When using 2.0, the HTTP status text is not included in the response: HTTP/2 404 Update the grep pattern so we handle both 1.1 and 2. If the credentials are invalid, the task will report: 21:49:40 -0700 CRIT: ERROR 401 21:49:40 -0700 CRIT: Unable to retrieve a valid package! If the requested package doesn't exist, the task will report: 21:56:33 -0700 CRIT: ERROR 404 21:56:33 -0700 CRIT: Unable to retrieve a valid package!
1 parent 061b172 commit f7cd3cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tasks/install_shell.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,14 @@ do_curl() {
429429
rc=$?
430430

431431
# check for 404
432-
grep "404 Not Found" $tmp_stderr 2>&1 >/dev/null
432+
grep "HTTP/.* 404" $tmp_stderr 2>&1 >/dev/null
433433
if test $? -eq 0; then
434434
critical "ERROR 404"
435435
unable_to_retrieve_package
436436
fi
437437

438438
# check for 401
439-
grep "401 Unauthorized" $tmp_stderr 2>&1 >/dev/null
439+
grep "HTTP/.* 401" $tmp_stderr 2>&1 >/dev/null
440440
if test $? -eq 0; then
441441
critical "ERROR 401"
442442
unable_to_retrieve_package

0 commit comments

Comments
 (0)