Skip to content

Commit

Permalink
fix: fix more useragents (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
revolunet authored Dec 9, 2024
1 parent 7c56b78 commit df1bae1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/declaration-rgpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
run: |
ls -la
cat rgpd2.json
[[ $(cat rgpd2.json | jq '.[0].score') -eq "3" ]] || (echo "Error: Should score 3" && exit 1)
[[ $(cat rgpd2.json | jq '.[0].score') -eq "4" ]] || (echo "Error: Should score 4" && exit 1)
2 changes: 1 addition & 1 deletion check-url/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
echo "testing URL $1"
wget -q -S --no-check-certificate --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36" "${INPUT_URL}"
wget -q -S --no-check-certificate --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 - dashlord" "${INPUT_URL}"
if ! [ "$?" -ne 0 ];
then
Expand Down
7 changes: 6 additions & 1 deletion declaration-a11y/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ const analyseFile = async (filePath, { url } = {}) => {

// warn: this wont work for SPA applications
const analyseUrl = async (url) => {
const dom = await JSDOM.fromURL(url);
const resourceLoader = new jsdom.ResourceLoader({
strictSSL: false,
userAgent:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0 - dashlord",
});
const dom = await JSDOM.fromURL(url, { resources: resourceLoader });
return analyseDom(dom, { url });
};

Expand Down
7 changes: 6 additions & 1 deletion declaration-rgpd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ const analyseFile = async (filePath, { url, thirdPartiesOutput } = {}) => {

// warn: this wont work for SPA applications
const analyseUrl = async (url) => {
const dom = await JSDOM.fromURL(url);
const resourceLoader = new jsdom.ResourceLoader({
strictSSL: false,
userAgent:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0 - dashlord",
});
const dom = await JSDOM.fromURL(url, { resources: resourceLoader });
return analyseDom(dom, { url });
};

Expand Down

0 comments on commit df1bae1

Please sign in to comment.