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.
|
# See comment in function below for details.
|
||||||
return ProcessCratesIoLink $linkUri $matches['path']
|
return ProcessCratesIoLink $linkUri $matches['path']
|
||||||
}
|
}
|
||||||
|
elseif ($linkUri -match '^https?://(www\.)?npmjs\.com/package/.+') {
|
||||||
|
return ProcessNpmLink $linkUri
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
return ProcessStandardLink $linkUri
|
return ProcessStandardLink $linkUri
|
||||||
}
|
}
|
||||||
@ -157,6 +160,14 @@ function ProcessCratesIoLink([System.Uri]$linkUri, $path) {
|
|||||||
return $true
|
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) {
|
function ProcessStandardLink([System.Uri]$linkUri) {
|
||||||
$headRequestSucceeded = $true
|
$headRequestSucceeded = $true
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user