Skip to content

Commit

Permalink
Revert "Ensure rest_route valid for plain permalink requests."
Browse files Browse the repository at this point in the history
This reverts commit 1e546ed.
  • Loading branch information
peterwilsoncc committed Aug 29, 2022
1 parent cddbaa7 commit 98339a4
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -809,13 +809,7 @@ public function check_connections() {
'endpoint_suggestion' => false,
);

$remote_request_url = untrailingslashit( $this->base_url );
if ( str_ends_with( $remote_request_url, '?rest_route=' ) ) {
// It's a request to get the REST API index using plain permalinks and needs a trailing slash.
$remote_request_url = user_trailingslashit( $remote_request_url );
}

$response = Utils\remote_http_request( $remote_request_url, $this->auth_handler->format_get_args( array( 'timeout' => self::$timeout ) ) );
$response = Utils\remote_http_request( untrailingslashit( $this->base_url ), $this->auth_handler->format_get_args( array( 'timeout' => self::$timeout ) ) );

$body = wp_remote_retrieve_body( $response );

Expand Down

0 comments on commit 98339a4

Please sign in to comment.