Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cocoapods.py generates some JSON-related URLs that lead to a 404 #3715

Open
johnmhoran opened this issue Mar 29, 2024 · 3 comments
Open

cocoapods.py generates some JSON-related URLs that lead to a 404 #3715

johnmhoran opened this issue Mar 29, 2024 · 3 comments
Labels

Comments

@johnmhoran
Copy link
Member

In connection with a purl2url issue in packageurl-python, I've been exploring the URL-related code in packagedcode's cocoapods.py. With the four PURL spec examples for cocoapods,

pkg:cocoapods/AFNetworking@4.0.1
pkg:cocoapods/MapsIndoors@3.24.0
pkg:cocoapods/ShareKit@2.0#Twitter
pkg:cocoapods/GoogleUtilities@7.5.2#NSData+zlib

I got the following results looking for potentially useful JSON files. Using the pattern

f'https://raw.githubusercontent.com/CocoaPods/Specs/blob/master/Specs/{hashed_path}/{name}/{version}/{name}.podspec.json'

from the get_urls() api_data_url variable, we get the following URLs, each of which leads to a 404: Not Found page:

A few lines above that pattern in get)url() is a pattern for the specs_json_cdn_url variable

f'https://cdn.cocoapods.org/Specs/{hashed_path}/{name}/{version}/{name}.podspec.json' 

For the same four cocoapods PURLs, this pattern generates valid URLs to cdn.cocoapods.org JSON files:

BTW, some of the URL data in these four .json files is not (or no longer) valid, e.g., the "homepage" URL for ShareKit (http://getsharekit.com/) leads to what might be a Turkish-language page -- https://smartem.org/. (The "source"/"git" URL (https://github.com/ShareKit/ShareKit.git) is valid and reflects that the last commit was made in December 2017.)

@johnmhoran johnmhoran added the bug label Mar 29, 2024
@pombredanne
Copy link
Member

So use instead:
f'https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/{hashed_path}/{name}/{version}/{name}.podspec.json'

@pombredanne
Copy link
Member

BTW, some of the URL data in these four .json files is not (or no longer) valid,

This would be another issue entirely ... We should have separate ways to crawl and tag invalid or dead URLs, and this would be implemented likely in the PurlDB, as some improver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants