1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Method Not Allowed returning a 500 http code

Discussion in 'Resolved Bug Reports' started by splebel, Mar 19, 2014.

  1. splebel

    splebel New Member


    I noticed that when a page requires the use of the POST method the server replies with a 500 error when using an invalid method (GET). This is handled by the _assertPostOnly() method in library/XenForo/Controller.php

    The error visible on the page is "This action is available via POST only. Please press the back button and try again." As the error is related to the method used to access the page it should return a "405 Method Not Allowed" error instead of a 500.

    You can reproduce by going to http://yoururl/login/login

    The patch is attached to this message.

    Attached Files:

  2. Mike

    Mike XenForo Developer Staff Member

    Good catch, though it needs a little bit more -- a 405 response MUST include an "Allow" header value, according to the spec. I've made additional changes to send that through as well.
    Liam W likes this.

Share This Page