Compare commits
2 Commits
main
...
sync-eng/c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e428909cc7 | ||
|
|
38b61682c5 |
@ -120,6 +120,9 @@ function ProcessLink([System.Uri]$linkUri) {
|
||||
# See comment in function below for details.
|
||||
return ProcessCratesIoLink $linkUri $matches['path']
|
||||
}
|
||||
elseif ($linkUri -match '^https?://(www\.)?npmjs\.com/package/.+') {
|
||||
return ProcessNpmLink $linkUri
|
||||
}
|
||||
else {
|
||||
return ProcessStandardLink $linkUri
|
||||
}
|
||||
@ -157,6 +160,14 @@ function ProcessCratesIoLink([System.Uri]$linkUri, $path) {
|
||||
return $true
|
||||
}
|
||||
|
||||
function ProcessNpmLink([System.Uri]$linkUri) {
|
||||
# npmjs.com started using Cloudflare which returns 403 and we need to instead check the registry api for existence checks
|
||||
# https://github.com/orgs/community/discussions/174098#discussioncomment-14461226
|
||||
$apiUrl = $linkUri.ToString() -replace '^https?://(www\.)?npmjs\.com/package/', 'https://registry.npmjs.org/'
|
||||
|
||||
return ProcessStandardLink ([System.Uri]$apiUrl)
|
||||
}
|
||||
|
||||
function ProcessStandardLink([System.Uri]$linkUri) {
|
||||
$headRequestSucceeded = $true
|
||||
try {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user