Skip to content

Commit f12cf88

Browse files
committed
Handle HEAD requests with curl's head option
1 parent 5ab078d commit f12cf88

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

skills/nginx-spa/scripts/verify-spa.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,16 @@ request() {
8585
method=$2
8686
path=$3
8787
header_file="$tmp_dir/$name.headers"
88-
curl -sS --connect-timeout 5 --max-time 15 -X "$method" -o /dev/null -D "$header_file" \
89-
-w '%{http_code}' "$base_url$path"
88+
case "$method" in
89+
HEAD)
90+
curl -sS --connect-timeout 5 --max-time 15 --head -o /dev/null -D "$header_file" \
91+
-w '%{http_code}' "$base_url$path"
92+
;;
93+
*)
94+
curl -sS --connect-timeout 5 --max-time 15 -X "$method" -o /dev/null -D "$header_file" \
95+
-w '%{http_code}' "$base_url$path"
96+
;;
97+
esac
9098
}
9199

92100
header_value() {

0 commit comments

Comments
 (0)