Skip to content

Commit da6b819

Browse files
authored
test
1 parent f1a1e17 commit da6b819

File tree

1 file changed

+6
-40
lines changed

1 file changed

+6
-40
lines changed

scripts/check_urls.sh

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,17 @@
77

88
set -x
99

10-
ua="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
11-
accept_hdr="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
12-
lang_hdr="en-US,en;q=0.9"
13-
enc_hdr="gzip, deflate, br"
14-
cache_hdr="no-cache"
15-
conn_hdr="keep-alive"
16-
10+
ua="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
1711
url="https://wiki.mozilla.org/Abstract_Interpretation"
12+
jar="/tmp/ci_cookies.txt"
1813

19-
curl -s -o /dev/null -w '%{http_code}\n' \
20-
-I \
21-
-A "$ua" \
22-
-H "Accept: $accept_hdr" \
23-
-H "Accept-Language: $lang_hdr" \
24-
-H "Accept-Encoding: $enc_hdr" \
25-
-H "Connection: $conn_hdr" \
26-
-H "Cache-Control: $cache_hdr" \
27-
"$url"
28-
29-
curl -s -o /dev/null -w '%{http_code}\n' \
30-
--range 0-0 \
31-
-A "$ua" \
32-
-H "Accept: $accept_hdr" \
33-
-H "Accept-Language: $lang_hdr" \
34-
-H "Accept-Encoding: $enc_hdr" \
35-
-H "Connection: $conn_hdr" \
36-
-H "Cache-Control: $cache_hdr" \
37-
"$url"
14+
curl -s -c "$jar" -A "$ua" --compressed "$url"
3815

39-
wget --spider --server-response --user-agent="$ua" "$url" 2>&1 \
40-
| awk '/^ HTTP\// { print $2 }'
16+
curl -s -b "$jar" -o /dev/null -w 'HEAD→%{http_code}\n' -I -A "$ua" "$url"
4117

42-
wget --spider --server-response --user-agent="$ua" --method=GET "$url" 2>&1 \
43-
| awk '/^ HTTP\// { print $2 }'
18+
curl -s -b "$jar" -o /dev/null -w 'RANGE→%{http_code}\n' --range 0-0 -A "$ua" "$url"
4419

45-
curl -s -o /dev/null -w '%{http_code}\n' \
46-
--http1.1 \
47-
-I \
48-
-A "$ua" \
49-
-H "Accept: $accept_hdr" \
50-
-H "Accept-Language: $lang_hdr" \
51-
-H "Accept-Encoding: $enc_hdr" \
52-
-H "Connection: $conn_hdr" \
53-
-H "Cache-Control: $cache_hdr" \
54-
"$url"
20+
curl -s -b "$jar" -o /dev/null -w 'GET →%{http_code}\n' -A "$ua" "$url"
5521

5622
set -euo pipefail
5723

0 commit comments

Comments
 (0)