Skip to content

Commit

Permalink
Replace \n with %0A
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlgo11 committed Dec 19, 2024
1 parent 1d80b29 commit 2e5c8b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/tests/Facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export default async function Facebook(handle) {

throw {
title: 'Facebook handle not found',
message: `Failed to find the Facebook page https://facebook.com/${handle}\\nThe page might be private or not exist.`
message: `Failed to find the Facebook page https://facebook.com/${handle}%0AThe page might be private or not exist.`
};
}
12 changes: 6 additions & 6 deletions src/tests/SimilarWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ export default async function(fqdn, env) {
case 403:
throw {
title: 'Manual review required',
message: 'Monthly API limit reached.\\nPlease wait for a maintainer to review your pull request.\\nhttps://www.similarweb.com/website/${domain}'
message: 'Monthly API limit reached.%0APlease wait for a maintainer to review your pull request.%0Ahttps://www.similarweb.com/website/${domain}'
};
case 404:
throw {
title: `${domain} is unranked`,
message: `${domain} lacks a SimilarWeb rank.\\nIf this domain is an additional domain, this warning can be ignored`
message: `${domain} lacks a SimilarWeb rank.%0AIf this domain is an additional domain, this warning can be ignored`
};
case 429:
throw {
title: 'Manual review required',
message: `Rate limit exceeded for SimilarWeb API while fetching ${domain} rank.\\nPlease wait for a maintainer to review your pull request.\\nhttps://www.similarweb.com/website/${domain}`
message: `Rate limit exceeded for SimilarWeb API while fetching ${domain} rank.%0APlease wait for a maintainer to review your pull request.%0Ahttps://www.similarweb.com/website/${domain}`
};
case 200:
break;
default:
throw {
title: `Failed to review ${domain}`,
message: `Unable to fetch the Similarweb global rank for ${domain}\\nStatus: ${res.statusText} (${res.status})`
message: `Unable to fetch the Similarweb global rank for ${domain}%0AStatus: ${res.statusText} (${res.status})`
};
}

Expand All @@ -53,13 +53,13 @@ export default async function(fqdn, env) {
// Soft fail on failure
if (json.meta.status !== 'Success') throw {
title: `Failed to review ${domain}`,
message: 'Unable to parse message from Similarweb API\\nPlease wait for a maintainer to review your pull request.\\nhttps://www.similarweb.com/website/${domain}'
message: 'Unable to parse message from Similarweb API%0APlease wait for a maintainer to review your pull request.%0Ahttps://www.similarweb.com/website/${domain}'
};

if (!Object.keys(json).includes('similar_rank')) {
throw {
title: `${domain} is unranked`,
message: `${domain} lacks a Similarweb rank.\\nIf this domain is an additional domain, this warning can be ignored`
message: `${domain} lacks a Similarweb rank.%0AIf this domain is an additional domain, this warning can be ignored`
};
}

Expand Down

0 comments on commit 2e5c8b8

Please sign in to comment.