mirror of https://github.com/flightphp/core
Merge pull request #550 from flightphp/overwrite-body
added ability to overwrite the bodypull/553/head v3.6.0
commit
735dafefb9
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
class OverwriteBodyMiddleware
|
||||||
|
{
|
||||||
|
public function after()
|
||||||
|
{
|
||||||
|
$response = Flight::response();
|
||||||
|
$response->write(str_replace('<span style="color:red; font-weight: bold;">failed</span>', '<span style="color:green; font-weight: bold;">successfully works!</span>', $response->getBody()), true);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue