TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Possible bug with HTTP_Exception (405) in 3.3
  • I'm having an issue with trying to throw a 405 error from a controller. Here is the code:

    throw HTTP_Exception::factory(405, ':method method not allowed here.',
            array(':method' => $this->request->method()))
        ->allowed(array_values($this->_action_methods)); // This produces => [POST,DELETE]
    

    The response headers seem to be getting set correctly:

    Allow:POST,DELETE
    Connection:Keep-Alive
    Content-Length:0
    Content-Type:text/html; charset=utf-8
    Date:Fri, 15 Feb 2013 13:43:58 GMT
    Keep-Alive:timeout=5, max=100
    Server:Apache/2.2.22 (Unix) DAV/2 PHP/5.4.3 mod_ssl/2.2.22 OpenSSL/0.9.8r
    X-Powered-By:PHP/5.4.3
    

    However, you will notice that content-length is 0. This results in there always being a blank screen instead of a stack. 405 seems to be the only one where this is happening. Am I just missing something?

  • Do you have any kind of http exception handling setup?

  • Or do you have php errors off?

  • Errors are set to true and for the sake of debugging I am not extending the HTTP_Exception class at all. So everything is pretty much stock. The other codes I'm trying are working as expected. e.g. 404, 500, 406, ect..

  • I'm able to replicate this. It's probably best to file a bug in our tracker.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion