mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-19 18:54:26 +00:00
REST API: Remove the Location redirect for the /users/me endpoint.
This is a re-commit of [38980], which was reverted in [38990]. Props youknowriad, jnylen0, pento. Fixes #38521. git-svn-id: https://develop.svn.wordpress.org/trunk@39085 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -635,11 +635,13 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
$request = new WP_REST_Request( 'GET', '/wp/v2/users/me' );
|
||||
|
||||
$response = $this->server->dispatch( $request );
|
||||
$this->assertEquals( 302, $response->get_status() );
|
||||
$this->assertEquals( 200, $response->get_status() );
|
||||
|
||||
$headers = $response->get_headers();
|
||||
$this->assertArrayHasKey( 'Location', $headers );
|
||||
$this->assertEquals( rest_url( 'wp/v2/users/' . self::$user ), $headers['Location'] );
|
||||
$this->assertArrayNotHasKey( 'Location', $headers );
|
||||
|
||||
$links = $response->get_links();
|
||||
$this->assertEquals( rest_url( 'wp/v2/users/' . self::$user ), $links['self'][0]['href'] );
|
||||
}
|
||||
|
||||
public function test_get_current_user_without_permission() {
|
||||
|
||||
Reference in New Issue
Block a user