Compare commits
No commits in common. "sync-eng/common-FixNpmLinkChecks-13281" and "main" have entirely different histories.
sync-eng/c
...
main
@ -120,9 +120,6 @@ 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
|
||||
}
|
||||
@ -160,14 +157,6 @@ 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