Closed emaborsa closed 9 months ago
Seems that 6xx error codes are not standard. So one option is map a function to throw this error code.
Yes i know, but since PHP allows it, why isn`t it allowed in Flight?
As @masakik said the 6xx error codes are not defined in the RFC. However, you can manually add it at the Response.php I guess.
This could be added as a pull request if you want. There's a list of http status codes and we could add the 6xx if they are semi-standard
I'm writing a REST endpoint and I need to return a custom code:
Flight::halt(601, "UPDATE NEEDED");
Unfortunately I get:
`500 Internal Server Error Invalid status code. (0)
0 C:\wamp64\www\cableparks\vendor\mikecao\flight\flight\Engine.php(397): flight\net\Response->status(601)`
So I have to write:
Flight::stop(); header('HTTP/1.1 601 UPDATE NEEDED', true); return;
Is it possible to integrate custom status codes?