Skip to content

Commit

Permalink
chore: scripts: increase timeout and add user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Oct 22, 2024
1 parent ecfb60b commit f9e5c1e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/utilities.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export async function validateUrl(url) {
response = await ky(url, {
throwHttpErrors: false,
redirect: 'manual',
timeout: 15000,
headers: {
'User-Agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36',
},
});
} catch (error) {
return {
Expand Down Expand Up @@ -144,9 +149,5 @@ export async function validateOpenDataUrl(url) {
}

export function slugify(name) {
return changeCase.kebabCase(
name
.toLowerCase()
.replace('\'', '')
);
return changeCase.kebabCase(name.toLowerCase().replace("'", ''));

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of "'".
}

0 comments on commit f9e5c1e

Please sign in to comment.