chore: record when a js challenge returned #1198
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This introduces debug information identifying when PyPI HTML content returns a JavaScript HTML page, to verify some other error or problem has not occurred.
Description of changes
When accessing PyPI HTML pages, Fastly, the CDN used by PyPI, may return a JavaScript Challenge to a GET request for a
pypi.orgHTML page. It is useful to know when this is the case, as this can cause some malware heuristics likeCloserReleaseJoinDate, which rely on this HTML content for maintainer information, to be unable to perform their analysis. If it is known that they were unable to perform their analysis due to this JavaScript Challenge response, this can confirm that some other network error or mangled HTML was not returned and was not the cause of the failure.Functions
get_package_pageandget_maintainer_profile_pagenow returnNoneif a JavaScript Challenge is returned, as this HTML content cannot be analysed without rendering the JavaScript, which is not a capability of Macaron.Checklist
verifiedlabel should appear next to all of your commits on GitHub.