Hello,
I have noticed that, if I get a "not found page" (the "He's dead, Jim!" one), Traq doesn't change the HTTP code and so returns a 200 OK. That's not a really important thing, but I think it would be cleaner if Traq could send the proper HTTP status code in such a case.
As far as I understand, I think it could be done in vendor/avalon/core/controller.php
, by adding a new key to the $_render array (let's say "http_status" for example) defaulted to null, then adding this line in the show_404 method:
$this->_render['http_status'] = '404';
And in the __shutdown method:
// Check if we have to send a specific HTTP code
if (!is_null($this->_render['http_status'])) {
if ($this->_render['http_status'] === '404') {
header("HTTP/1.0 404 Not Found");
}
}
The same could be done for the no_permission page as well with a 403 Forbidden code.
Ok, thank you :) And sorry for the text formatting, it broke for some reason. I suspect a Firefox extension to break editors since I had some issues elsewhere as well, I have yet to find the guilty...
Could also just call the
header
function in theaction_404
andshow_no_permission
methods instead of having a bunch of lines of extra code in the__shutdown
method.