Closed dimitrihilverda closed 1 year ago
How about just regular PHP: header('X-Hook-Secret: something');
I tried with both static access and dynamic access; both cases work.
Try something really basic like this. See if the response headers come through.
<?PHP
require_once "./vendor/autoload.php";
Flight::response()->header('X-Hook-Secret', "DIRK");
Flight::route("*", function() {
echo 69;
});
Flight::start();
Ok, I found the problem, It works now as it should, somhow I had a file included that had a space before the <?php tag, that gave me an error in the logs that sayed, headers already send,,, My local setup was more strict than my production setup.
So not a bug or error on the Flight side, it was all on my side, thank you all!
This will set a header:
Flight::response()->header('X-Hook-Secret',$secret);
I see that it is set:var_dump(Flight::response()->headers());
but then when I use
Flight::json(response($activities, 'success'));
and look at the headers, I used postman to test the endpoint, this header is not there...Is there any way to add headers?