File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,9 @@ function ProcessLink([System.Uri]$linkUri) {
120120 # See comment in function below for details.
121121 return ProcessCratesIoLink $linkUri $matches [' path' ]
122122 }
123+ elseif ($linkUri -match ' ^https?://(www\.)?npmjs\.com/package/.+' ) {
124+ return ProcessNpmLink $linkUri
125+ }
123126 else {
124127 return ProcessStandardLink $linkUri
125128 }
@@ -157,6 +160,14 @@ function ProcessCratesIoLink([System.Uri]$linkUri, $path) {
157160 return $true
158161}
159162
163+ function ProcessNpmLink ([System.Uri ]$linkUri ) {
164+ # npmjs.com started using Cloudflare which returns 403 and we need to instead check the registry api for existence checks
165+ # https://github.com/orgs/community/discussions/174098#discussioncomment-14461226
166+ $apiUrl = $linkUri.ToString ().Replace(" https://www.npmjs.com/package/" , " https://registry.npmjs.org/" )
167+
168+ return ProcessStandardLink ([System.Uri ]$apiUrl )
169+ }
170+
160171function ProcessStandardLink ([System.Uri ]$linkUri ) {
161172 $headRequestSucceeded = $true
162173 try {
You can’t perform that action at this time.
0 commit comments