mirror of https://github.com/flightphp/core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
442 B
22 lines
442 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Server;
|
|
|
|
use Flight;
|
|
|
|
class OverwriteBodyMiddleware
|
|
{
|
|
public function after(): void
|
|
{
|
|
$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);
|
|
}
|
|
}
|