Skip to content

Commit

Permalink
[AsyncHttp\Client] Reuse the original request method on redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Dec 17, 2024
1 parent 759c614 commit 53efc0e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/WordPress/AsyncHttp/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,15 @@ private function handle_redirects( $requests ) {
}

$this->events[ $request->id ][ Client::EVENT_REDIRECT ] = true;
$this->enqueue( new Request( $redirect_url, [ 'redirected_from' => $request ] ) );
$this->enqueue(
new Request(
$redirect_url,
[
'method' => $request->method,
'redirected_from' => $request,
]
)
);
}
}

Expand Down

0 comments on commit 53efc0e

Please sign in to comment.