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

added ability to convert the response body #571

Merged
merged 2 commits into from
Apr 10, 2024
Merged

Conversation

n0nag0n
Copy link
Collaborator

@n0nag0n n0nag0n commented Apr 9, 2024

This will allow you to minify, gzip, whatever you'd like to do with the response body.

Flight::response()->addResponseBodyCallback(function($body) {
    return gzencode($body, 9);
});

@n0nag0n n0nag0n mentioned this pull request Apr 9, 2024
Copy link
Contributor

@BelleNottelling BelleNottelling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks perfect for my use-case.
Appreciated :)

@n0nag0n n0nag0n merged commit d92c65f into master Apr 10, 2024
@n0nag0n n0nag0n deleted the response-body-callback branch April 10, 2024 01:47
@n0nag0n
Copy link
Collaborator Author

n0nag0n commented Apr 10, 2024

Added documentation here. https://docs.flightphp.com/learn/responses#running-a-callback-on-the-response-body

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