savinmikhail / symfony-profiler-response-bundle
Symfony Web Profiler panel to display JSON/text response bodies with size limits and guards (dev-only)
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/savinmikhail/symfony-profiler-response-bundle
Requires
- php: >=8.1
- symfony/config: ^5.4 || ^6.0 || ^7.0
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.0
- symfony/http-foundation: ^5.4 || ^6.0 || ^7.0
- symfony/http-kernel: ^5.4 || ^6.0 || ^7.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- symfony/framework-bundle: ^5.4 || ^6.0 || ^7.0
- symfony/routing: ^5.4 || ^6.0 || ^7.0
- symfony/web-profiler-bundle: ^5.4 || ^6.0 || ^7.0
README
Symfony Profiler Response Bundle
Dev-only Symfony bundle that adds a "Response Body" panel to the Web Profiler, showing JSON/text response payloads with size limits and sensible guards.
Features
- Captures response body for textual and JSON-like MIME types
- Skips streamed/binary responses to avoid breaking downloads
- Truncates large payloads (default 256 KB) to protect the toolbar
- Pretty-prints JSON when possible
Installation
composer req --dev savinmikhail/symfony-profiler-response-bundle
- Register the bundle in your app (though flex should do it for you):
// config/bundles.php return [ // ... SavinMikhail\\ResponseProfilerBundle\\ResponseProfilerBundle::class => ['dev' => true], ];
- Optional config (dev):
config/packages/dev/response_profiler.yaml
response_profiler: enabled: true max_length: 262144 # bytes (256 KB) allowed_mime_types: - application/json - application/ld+json - application/problem+json - application/vnd.api+json - text/plain - text/json
Usage
- In the Web Profiler, open any request and look for the new "Response Body" tab.
- The toolbar badge shows MIME and size; the panel shows headers and the (pretty-printed) body, truncated if oversized.
Appearance
Notes
- This bundle is designed for development. Do not enable in production.
- Streamed and binary responses are ignored.
- Pretty-printing of very large JSON may be skipped when payloads are huge.