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

Add Headers::qfactors() to implement content negotiation #115

Merged
merged 4 commits into from
May 26, 2024

Conversation

thekid
Copy link
Member

@thekid thekid commented May 25, 2024

Example:

$preference= Headers::qfactors()->parse('deflate, gzip;q=1.0, *;q=0.5');
// ['deflate' => 1.0, 'gzip' => 1.0, '*' => 0.5]

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation

@thekid
Copy link
Member Author

thekid commented May 25, 2024

MDN writes:

The Accept-Encoding header defines the acceptable content encoding (supported compressions). The value is a q-factor list (e.g., br, gzip;q=0.8) that indicates the priority of the encoding values.

Should the method be named qfactors() or qualityfactors() instead?

@thekid thekid changed the title Add Headers::qvalues() to implement content negotiation Add Headers::qfactors() to implement content negotiation May 26, 2024
@thekid thekid merged commit 10249e3 into master May 26, 2024
20 checks passed
@thekid thekid deleted the feature/qvalues branch May 26, 2024 15:00
@thekid
Copy link
Member Author

thekid commented Jun 10, 2024

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.

1 participant