-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8acc05
commit 23d7ba3
Showing
3 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"path": "/*", | ||
"resourceSizes": [ | ||
{ | ||
"resourceType": "total", | ||
"budget": 200 | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Parse index.html and extract all href attributes starting with https:// | ||
links=$(grep -o 'href="https://[^"]*' ./app/templates/index.html | sed 's/href="//') | ||
|
||
# Function to check if a given status code is acceptable | ||
is_acceptable_status() { | ||
case "$1" in | ||
200|403|999) return 0 ;; | ||
*) return 1 ;; | ||
esac | ||
} | ||
|
||
# Loop through each https:// link and check existence with curl | ||
for link in $links; do | ||
response=$(curl -sL -w "%{http_code}" "$link" -o /dev/null) | ||
if is_acceptable_status "$response"; then | ||
echo "Link $link exists (HTTP $response)" | ||
else | ||
echo "Link $link does not exist or has an unacceptable status code (HTTP $response)" | ||
exit 1 | ||
fi | ||
done |