Make WordPress Core


Ignore:
Timestamp:
12/21/2020 08:21:12 PM (4 years ago)
Author:
johnbillion
Message:

XML-RPC: Emit an appropriate HTTP status code when an error is returned in response to an XML-RPC request.

This most notably affects the response when XML-RPC is disabled or when the supplied username and password is incorrect.

Props ericmann

Fixes #48213

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/xmlrpc/basic.php

    r48937 r49862  
    1515        // If disabled, 405 would result.
    1616        $this->assertSame( 403, $result->code );
     17    }
     18
     19    function test_disabled() {
     20        add_filter( 'xmlrpc_enabled', '__return_false' );
     21
     22        $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
     23
     24        $this->assertIXRError( $result );
     25        $this->assertSame( 405, $result->code );
    1726    }
    1827
Note: See TracChangeset for help on using the changeset viewer.