Skip to content

Commit

Permalink
corrected spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
n0nag0n committed Feb 19, 2024
1 parent d8aa490 commit 2439f20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
6 changes: 3 additions & 3 deletions flight/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,9 @@ public function _json(
->status($code)
->header('Content-Type', 'application/json; charset=' . $charset)
->write($json);
if($this->response()->v2_output_buffering === true) {
$this->response()->send();
}
if ($this->response()->v2_output_buffering === true) {
$this->response()->send();
}
}

/**
Expand Down
23 changes: 11 additions & 12 deletions tests/server/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
// Test 1: Root route
Flight::route('/', function () {
echo '<span id="infotext">Route text:</span> Root route works!';
if(Flight::request()->query->redirected) {
echo '<br>Redirected from /redirect route successfully!';
}
if (Flight::request()->query->redirected) {
echo '<br>Redirected from /redirect route successfully!';
}
});
Flight::route('/querytestpath', function () {
echo '<span id="infotext">Route text:</span> This ir query route<br>';
Expand Down Expand Up @@ -99,22 +99,21 @@
trigger_error('This is a successful error');
});

// Test 10: Halt
Flight::route('/halt', function() {
Flight::halt(400, 'Halt worked successfully');
});

// Test 10: Halt
Flight::route('/halt', function () {
Flight::halt(400, 'Halt worked successfully');
});
}, [ new LayoutMiddleware() ]);

// Test 9: JSON output
Flight::route('/json', function() {
Flight::json(['message' => 'JSON renders successfully!']);
Flight::route('/json', function () {
Flight::json(['message' => 'JSON renders successfully!']);
});


// Test 11: Redirect
Flight::route('/redirect', function() {
Flight::redirect('/?redirected=1');
Flight::route('/redirect', function () {
Flight::redirect('/?redirected=1');
});

Flight::map('error', function (Throwable $e) {
Expand Down

0 comments on commit 2439f20

Please sign in to comment.