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

Enhance req.acceptsEncodings Method 5.x #5870

Closed

Conversation

Abdel-Monaam-Aouini
Copy link
Contributor

Enhance req.acceptsEncodings Method

This enhancement refines the req.acceptsEncodings method to improve the handling of the request's Accept-Encoding header. The updated method checks whether the client accepts the specified encoding(s) and returns the best matching encoding or an array of acceptable encodings.

Key Features:

  • Supports single or multiple encoding strings and a comma-delimited list of encodings.
  • Provides consistent behavior across different input formats.
  • Enhances code readability and maintainability.

Examples:

  • req.acceptsEncodings('gzip') returns "gzip" when the Accept-Encoding header includes "gzip".
  • req.acceptsEncodings('br') returns undefined if the encoding isn't accepted by the client.
  • req.acceptsEncodings('gzip, deflate') returns "gzip" as the best match.

This update ensures more robust handling of accepted encodings, improving compatibility and performance.

@wesleytodd
Copy link
Member

I was going through issues and noticed this. We did not mean to close these, it was a consequence of deleting the 5.x branch after we merged. I am really sorry we accidentally closed these. I am at a conference right now, so cannot go about finding and re-opening them, but if you want to re-target them to master and re-open that would be awesome. If not I can get to it at some point.

@Abdel-Monaam-Aouini
Copy link
Contributor Author

I was going through issues and noticed this. We did not mean to close these, it was a consequence of deleting the 5.x branch after we merged. I am really sorry we accidentally closed these. I am at a conference right now, so cannot go about finding and re-opening them, but if you want to re-target them to master and re-open that would be awesome. If not I can get to it at some point.

done #6086

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

Successfully merging this pull request may close these issues.

2 participants