October: Returning 404 from a component sets incorrect headers

Created on 28 Jan 2017  路  3Comments  路  Source: octobercms/october

Expected behavior

Headers:
Status Code:404 Not Found

Actual behavior

Headers:
Status Code:200 OK

Reproduce steps
  1. Create new component

~
class Something extends ComponentBase
{
public function onRun()
{
$this->setStatusCode(404);
return $this->controller->run('404');
}
}
~

  1. Open page with new component and check headers
October build

393

Review Needed Unconfirmed Bug

All 3 comments

It seems that everything is fine for build: 361. So something has changed in recent versions

I think you have to put this on the init method

This should have been fixed in 2350e30853cc2c1337697bb38c113f7319eea0f1 (Build 319+)

Was this page helpful?
0 / 5 - 0 ratings