Skip to content

Conversation

@woodruffw
Copy link
Member

@woodruffw woodruffw commented Jan 24, 2025

This tweaks the Accept handling for this endpoint in the following ways:

  1. We no longer accept HTML mimetypes only to reject them later, since this results in a confused state between accept matching and the actual HTTP response
  2. We use the 'identity' marker to ensure an adequate fallback when the user doesn't explicitly specify Accept
  3. We now accept application/json, although this could be removed from the changeset

(NB: The main reason I added application/json is to ensure fallbacks/q-factor sorting works as expected.)

I've also added a bunch of parametrized tests to ensure that we handle various combinations/orders/q-values correctly.

See #17084.

@woodruffw woodruffw requested a review from a team as a code owner January 24, 2025 19:48
@woodruffw woodruffw self-assigned this Jan 24, 2025
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
@woodruffw woodruffw requested a review from di January 27, 2025 17:06
Signed-off-by: William Woodruff <[email protected]>
@di di merged commit 6afcba5 into pypi:main Jan 27, 2025
20 checks passed
@di di deleted the ww/integrity-better-accept branch January 27, 2025 17:14
@Blend1221
Copy link

trail-of-forks:ww/integrity-better-accept

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants