Skip to content

Commit

Permalink
Update Vite.php
Browse files Browse the repository at this point in the history
Fixed automatic replacement of domain names accessed by clients for vite hot
  • Loading branch information
ellermister authored Mar 9, 2024
1 parent f2bff1c commit ebd20cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Foundation/Vite.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ public function reactRefresh()
*/
protected function hotAsset($asset)
{
return rtrim(file_get_contents($this->hotFile())).'/'.$asset;
$hotURL = parse_url(file_get_contents($this->hotFile()));
$hotURLNew = str_replace('//' . $hotURL['host'], '//' . app(Request::class)->getHost(), file_get_contents($this->hotFile()));
return rtrim($hotURLNew) . '/' . $asset;
}

/**
Expand Down

0 comments on commit ebd20cc

Please sign in to comment.