Skip to content

Commit

Permalink
AsyncHttp\Client – add Request::original_request method
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Jul 15, 2024
1 parent 9a26c5e commit e08b224
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/WordPress/AsyncHttp/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,13 @@ public function latest_redirect() {
return $request;
}

public function original_request() {
$request = $this;
while ( $request->redirected_from ) {
$request = $request->redirected_from;
}

return $request;
}

}

0 comments on commit e08b224

Please sign in to comment.