Skip to content

Commit 143e0a8

Browse files
committed
Add number to list of redirects
Signed-off-by: Arul Selvan <[email protected]>
1 parent 23c4347 commit 143e0a8

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

security/list_url_redirects.sh

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,6 @@ EOF
4242
exit 0
4343
}
4444

45-
make_api_call() {
46-
http_status=$(curl -s -o $http_output -w "%{http_code}" "$uri")
47-
log.debug "HTTP status: $http_status"
48-
if [ "$http_status" -eq 200 ] ; then
49-
check_installed jq noexit
50-
if [ $? -eq 0 ] ; then
51-
cat $http_output | jq
52-
else
53-
cat $http_output
54-
fi
55-
elif [ "$http_status" -eq 429 ] ; then
56-
log.warn "\tAPI returned: 'too many requests', retry again after few seconds."
57-
else
58-
log.error "\tAPI call failed! HTTP status = $http_status"
59-
fi
60-
}
61-
6245
# ------------------------------- main -------------------------------
6346
# First, make sure scripts root path is set, we need it to include files
6447
if [ ! -z "$scripts_github" ] && [ -d $scripts_github ] ; then
@@ -113,8 +96,10 @@ while true; do
11396
done
11497

11598
# Output all intermediate URLs
116-
log.stat "Redirect chain: "
117-
log.stat " ---> $url"
99+
order=1
100+
log.stat "Redirect chain order: "
101+
log.stat " ${order}. ---> $url"
118102
for redirect in "${redirect_list[@]}"; do
119-
log.stat " ---> $redirect"
103+
((order++))
104+
log.stat " ${order}. ---> $redirect"
120105
done

0 commit comments

Comments
 (0)