-
Notifications
You must be signed in to change notification settings - Fork 967
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
Serve provenance without requiring the Accept header #17084
Comments
This is covered by the documentation here (I didn't think to look so I dug around in the source code instead): https://docs.pypi.org/api/integrity/#get-provenance-for-file Although the docs say:
Which I think is incorrect documentation - you have to pass the Accept header to see the format shown in that example. |
Your browser is almost certainly sending
|
Running curl -s https://pypi.org/integrity/pydantic/1.10.19/pydantic-1.10.19-cp310-cp310-macosx_11_0_arm64.whl/provenance Not great from a developer experience / usability POV though, since I do a lot of my API research these days on a phone with Mobile Safari! |
That's because by default curl accepts any content type (
The issue is that we want to respect the |
What's the problem this feature will solve?
When I visit this page in my browser:
https://pypi.org/integrity/pydantic/1.10.19/pydantic-1.10.19-cp310-cp310-macosx_11_0_arm64.whl/provenance
I get this:
To see the content of that page I have to send an
accept
header like this:Describe the solution you'd like
I'd prefer it if the page served me JSON without me having to send that accept header. That way I could explore and understand the API without needing to fire up a terminal or a custom HTTP client.
Additional context
Here's the implementation:
warehouse/warehouse/api/integrity.py
Lines 62 to 67 in 06a2b58
The text was updated successfully, but these errors were encountered: